I have connected one of my production server folders with my "ssh account" server via sshfs.
I often need to find out pwd (or realpath) of the file on the original (production) server, but the pwd returns the path to file on the connected ("ssh account") server.
Is there a way to get original path?
Thanks
Edit: more about this: I am using this to link my ssh server to multiple different SFTP servers/shared hosting.
so, if i do this (on some of the servers): sshfs user@domain:/ mount_point, then I am connected to my FTP account, which acts as root for my user, but is more along something like /var/www/clients/c/a/account/pub/ and that's the path I need –
sshfs user@domain:/ mount_point # mount SFTP acc.
cd mount_point
XXXX file.ext # get back: /var/www/clients/…/pub/file.ext
pwd file.ext # returns /ssh-server/path/mount_point/file.ext
Hope it makes sense now.
Thanks
/ssh-account/path/to/file… the wrong one – Adam Kiss Nov 14 '12 at 13:08sshdon the server is run in a chroot such that its/is not the actual/on the server and you want that actual/, there is no way to get the actual/on the server via ssh. You could, however, still define an alias as suggested in my answer and simply replace the/var/www/mywebsiteaccordingly (for example, use/var/www/clients/c/a/account/pubor so). In order not to define multiple aliases, you could parse the output ofmount, decide where this actually points to using the username given tosshfsand then build the output accordingly. – Claudius Nov 14 '12 at 13:20pwd --see-through-every-mount-and-symlink:D – Adam Kiss Nov 14 '12 at 13:22pwd --blatantly-defy-chroot --ignore-filesystem-restrictions --find-absolutely-the-absolute --accept-no-substitutes --never-surrender? – Xyon Nov 15 '12 at 7:17