SSHFS remote softlinks requires follow_symlinks

less than 1 minute read

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. This works from Linux, Mac, BSD, Cygwin and Windows Subsystem for Linux.

Example

  1. setup server:
    ln -s /media/BigHDD ~/BigHDD
    
  2. on laptop create joeBigHDD.sh
    #!/bin/sh
    sshfs -o follow_symlinks [email protected]: ~/X
    

    then

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

Categories:

Updated:

Leave a Comment