Mount a Remote Folder using SSH on Ubuntu
Posted by admin on December 30th, 2006
Email This Post
sshfs is based on FUSE (userspace filesystem framework for Linux), thus you will have to prepare fuse kernel module to be able to use it.
Install sshfs in Ubuntu
sudo apt-get install sshfs
This will complete the installation part.
Now we will use the modprobe command to load it
sudo modprobe fuse
Now you need to set up some permissions in order to access the utilities. Replace with your username.
sudo adduser fuse
sudo chown root:fuse /dev/fuse
sudo chmod +x /dev/fusermount
Since we’ve added ourselves to a user group, we need to logout and back in at this point before we continue.
Now we’ll create a directory to mount the remote folder in. I chose to create it in my home directory and call it remoteserv.
mkdir ~/remoteserv
Now we have the command to actually mount it. You’ll be prompted to save the server key and for your remote password.
sshfs username@ipaddress:/remotepath ~/remoteserv
In the above command you need to replace usename and ipaddress.
Now you should be able to cd into the directory and start using it as if it was local.
user@testserver:~/remoteserv$ ls -l
total 16
drwxr-xr-x 1 951247 155725 4096 2006-16-13 13:03 Music
drwxr-sr-x 1 root root 4096 2006-10-11 06:05 logs
drwx—— 1 951247 155725 4096 2006-02-11 16:19 Documents
drwxrwxr-x 1 951247 155725 4096 2006-10-09 02:43 scripts
If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!


January 2nd, 2007 at 11:08 pm
Hi, thx for the guide, however I have some questions, where you say “replace with your username”, do you mean to replace fuse with “yourusername”, and should it be the username of the ssh server?
Another question about the ip adress, shoud it be from your pc, or from the ssh server?
January 3rd, 2007 at 8:46 am
jan you need to replace username and ipaddress of ssh server
January 16th, 2007 at 1:27 pm
instead of
sudo chmod +x /dev/fusermount
you should change permissions of another file:
sudo chmod +x /usr/bin/fusermount
January 24th, 2007 at 11:05 pm
Can you connect to Ubuntu via sshfs using the x-windows, I mean like remote desktopn in Windows, where you can control the pc remotely
March 19th, 2007 at 3:01 am
stan: you don’t need sshfs to do remove desktop type stuff with X over ssh.
probably the easiest way is to start another X session on the local machine and use it to run X in over ssh. this would all be from the text login (F1):
> X :1 &
> export DISPLAY=:1
> ssh -Y user@host
user@host> gnome-session &
then gnome should be running on display :1 (F9)
the only problem i’ve seen is when you quit the gnome session on the remote server gnome will likely leave some things running and you won’t be able to exit the ssh session with killing them. stuff like x-screensaver etc. i assume this would be similar with kde too.
December 27th, 2007 at 2:11 am
I really don’t recommend this method, at least I had quite a few problems with it. I used sshfs to mount a server and had troubles with both file transfers and rights.
Both Nautilus (”Connect to server” in Ubuntu Gnome) and Konqueror support ssh for remote connections, and it works much better.
April 2nd, 2008 at 3:36 pm
@ Audun,
The connect to server option in Gnome actually uses SFTP which is a subsystem of SSH. If SFTP is not enabled on the SSH server’s config file, you won’t be able to connect.
May 8th, 2008 at 7:14 am
Finally got this to work after several attempts. In case others are having problems here’s some clarifications:
1.replace root in the following with your username: sudo chown root:fuse /dev/fuse
2. location of fusermount is /bin/fusermount (in kubuntu anyway), so use:
sudo chmod +x /bin/fusermount
or find it with whereis fusermount
Also, since I was not using the user I installed with I had to add give the user privs to use sudo first - search on SudoRoot above
Hope this helps!