Mounting a Remote Directory Over SSH in Linux

opensshIf you always find yourself accessing folders on a remote server over ssh, and you don’t want to open a share to the network or install additional services like samba or NFS, You can mount directories that you access over ssh locally with sshfs. Following are the steps on how to accomplish this.
1- Install SSHFS

sudo apt-get install sshfs

2- Add your username to fuse group, so you can mount the directory without using sudo

sudo usermod -a -G fuse $USER

3- make change permanet

exec su -l $USER

4- Assign your user account the right permissions over the mount point

sudo chmod o+rwx /mountpoint

5- Finally you can mount the remote directory as yourself with the following command.

sshfs user@remotehost:/mnt/directory /media/ssh

Remember that you still will be prompted for authentication on remote host. However, you can disable that by following the steps here
Additionally, you can unmount the directory like this

fusermount -u /mountpoint
Share This!
Tags:, , ,
5 Comments

Add a Comment

Your email address will not be published.

Sign up for our Newsletter

Download "Google Search Pro"

Enter your email and stay on top of things,

Subscribe!