Last active
August 29, 2015 13:56
-
-
Save ralavay/9105578 to your computer and use it in GitHub Desktop.
Install SSHFS in Ubuntu to mount remote folder to local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 [email protected]:/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