A simple helper script to mount and unmount remote directories
- Install sshfs.
git clone https://github.com/danielrw7/sshfs-open.git
- If you want to add
sshfs-opento your PATH, add this to your bashrc:
$ sshfs-open [host:directory] [command]
$ ./sshfs-open email@example.com:/some/dir Mounted ./firstname.lastname@example.org:,some,dir Press [CTRL+C] to exit
To run a command on the mounted directory, pass the commands and arguments after the remote directory:
# Open the mounted directory with atom $ ./sshfs-open email@example.com:/some/dir atom Mounted ./firstname.lastname@example.org:,some,dir Press [CTRL+C] to exit
Once you press CTRL+C, the mounted directory will be unmounted, and any child processes will be killed (if you passed a command).