Skip to content

Instantly share code, notes, and snippets.

@ralavay
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralavay/9105578 to your computer and use it in GitHub Desktop.
Save ralavay/9105578 to your computer and use it in GitHub Desktop.
Install SSHFS in Ubuntu to mount remote folder to local
#!/bin/bash
#
# Install SSHFS to mount remote folder to local folder -> edit code with Sublime for example
# Install sshfs
sudo apt-get install sshfs -y
sudo modprobe fuse
# Get your username
YOUR_USER_NAME=$(whoami)
sudo adduser $YOUR_USER_NAME fuse
sudo chown root:fuse /dev/fuse
sudo mkdir /dev/fusermount
sudo chmod +x /dev/fusermount
echo "====================
1. Create a folder somewhere like *~/Mount*
2. You could *mount* the remote folder to *~/Mount* by this command
sshfs <username>@<ipaddress>:/remotepath ~/Mount
For example I have server *192.168.1.20* with user is *test* and the project folder is */home/test/test_project*
so I can mount that to my local *~/Mount* by
sshfs test@192.168.1.20:/home/test/test_project ~/Mount
Now you can *cd ~/Mount* and run Sublime to edit the code. Changes will affect to remote content directly.
To *umount* the remote folder
sudo umount ~/Mount
You can create many folders and mount many remote folders if you want.
=========DONE==========="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment