Sometimes you have a need to use a directory soft link over SSHFS. Example: your server has an external harddrive or flashdrive that you’ve plugged in and you want to access it remotely via SSHFS.
You could modify your fstab or use sudo mount, but a more casual option is to put a soft link into the directory where you usually connect with SSHFS that points to that drive, and use the
-follow_symlinks option of SSHFS.
external HDD automounted to
/media/BigHDD to your server with IP address 220.127.116.11 and you use username joe,
mapping the remote SSHFS to your laptop at
Here’s the one-time setup for that drive:
login to remote (server) PC (locally or via SSH) and type
ln -s /media/BigHDD ~/BigHDD
make a script on your laptop, consisting of:
#!/bin/sh sshfs -o follow_symlinks [email protected]: ~/X
connect via SSHFS to external server HDD
after running the script from step 2.
To disconnect the SSHFS drive, as usual type on your laptop
fusermount -uz ~/X