SSHFS remote softlinks requires follow_symlinks

Softlinks are useful on any operating system to replace long, complicated directory paths with a simpler one. Options for accessing remote softlinked paths over SSHFS is best done with the sshfs -follow_symlinks option.

Example

  • Server: joe@1.2.3.4 with external HDD /media/BigHDD
  • Laptop: remote SSHFS ~/X
  1. setup server:
   ln -s /media/BigHDD ~/BigHDD
   
  1. on laptop create joeBigHDD.sh
   #!/bin/sh
   sshfs -o follow_symlinks joe@1.2.3.4: ~/X
   

then

   mkdir ~/X
   chmod +x joeBigHDD.sh
   
  1. connect to remote HDD from laptop via SSHFS
   ./joeBigHDD.sh
   
   cd ~/X/BigHDD
   
  1. To disconnect the SSHFS drive, on laptop:
   fusermount -uz ~/X