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!

5 thoughts on “Mounting a Remote Directory Over SSH in Linux

  1. jimmyx

    Hey, I followed the tutorial, but I’m not able to change directory after mounting the remote directory… how could I access the mount point?

  2. Melva

    It’s hard to find your blog in google. I found it on 19 spot, you should build quality backlinks ,
    it will help you to get more visitors. I know how to help you, just search in google – k2 seo tricks

Leave a Reply

Your email address will not be published.