Mount server file system over SSH on Ubuntu 12.04

I'm now running my own instance of Ubuntu 12.04 server at home and its great. I tend to use PHP Storm as my development IDE and I don't like how it copies all the files over to your system if you choose the remote options. Therefore mounting the remote file system as though it was local is idea. Below are the commands required, they don't need much explaining.

sudo apt-get install sshfs
usermod -G yourusername fuse
mkdir ~/remote-sites
sshfs [email protected]:/var/www ~/sites

If you need to unmount the filesystem you can use:

fusermount -u ~/remote-sites

Comments

Permalink

Thanks for this Ben!

The command "nautilus sftp://[email protected]/PATH" is not working for me (I get the error: "Timed out when logging in. Please select another viewer and try again") and I couldn't solve that even though I tried different solutions from ubuntu forums.

Now I could mount the filesystem using sshfs.

Did you miss the --append option in the second command? I used "sudo gpasswd -a $USER fuse" to add my user to the fuse group.

Thanks again!

Permalink

The command above is wrong "usermod -G yourusername fuse" is wrong and very dangerous as it will remove any groups that you are currently in and replace them with just fuse... (I just lost 20 minutes of my life recovering my sudo access!) you need to APPEND the new group "fuse" using "usermod -aG fuse yourusername " instead... note that "fuse" comes before "yourusername" as there is no group "yourusername"...

Permalink

This post is pretty old, I think the correct way to do this now is "sudo adduser user group".

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.