mount remote directory to use it locally - vicgalle/wiki-example GitHub Wiki

#TODO#: IF YOU MOUNT YOUR LOCAL FOLDER, WHICH USUALLY HAS A SYMBOLIC LINK TO THE SHARED FOLDER, THE SYMBOLIC LINK DOES NOT WORK. I WAS ONLY ABLE TO ACCESS TO THE SHARED FOLDER DIRECTLY LINKING TO IT (WITH ITS ABSOLUTE PATH)

Mount a remote directory to use local editors such as atom, emacs, vim, ... with local configuration, for instance with carlitos server

Requires: sshfs installation

  • MacOS (using brew) $ brew install sshfs
  • Ubuntu (using apt-get) sudo apt-get install sshfs

we create first a local directory, the mountpoint, since it must exist in advance

$ mkdir ClusterCarlitosFolder

Link a directory dir in the remote host with the local mountpoint using

$ sshfs [user@]host:[dir] mountpoint

E.g.:

$ sshfs -p 5555 [email protected]:/home/yourUser ClusterCarlitosFolder

or, if you have configured the remote host in the ~/.ssh/config file

$ sshfs carlitos:/home/yourUser ClusterCarlitosFolder

we can also alias the command into the file ~/.bashrc (Linux), ~/.aliases (OS X) , ~/.zshrc (Zsh)

alias mountCarlitos='sshfs -p 5555 [email protected]:/home/yourUser ClusterCarlitosFolder'

Sources

https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh