A blog about computers, open source, software and other perceptions gained over the years as a sysadmin.

Thursday, February 18, 2010

Very nice way of connecting your Linux desktop to your server with SSHFS.


One thing i have always struggled with is howto connect my desktop to my Linux servers or another Linux desktop. I have used SCP, SMB, FTP, NFS and various other ways but they have not been that optimal for my needs.

  • I want my traffic to be encrypted or atleast the login to be. 
  • Using the remote files should be transparent, both to me and all my applications.
  • I want enough speed to be able to watch movies directly from files off of the remote computer.
  • I want to have the same read/write permissions as the account i setup on the remote server.



SSHFS does all this in a very easy way. You mount your remote machine onto a normal user accounts home directory on its own folder. In my case i mount it to /home/username/Desktop/servername and get all my remote files right there on my desktop in the servername folder.

First you have to install FUSE if you dont already have support for it.

fuselink http://fuse.sourceforge.net/sshfs.html

Then make sure your user is in the fuse group so you have permission to use fuse at all.

Make sure the fuse module is loaded and then try it out.

The command for me is this:

 sshfs root@server:/folder/ /home/username/Desktop/servername/



If you want to make all this transparent, put the sshfs command in your autostart. Then export your keys to the remote server with ssh-copy-id.  See this excellent guide for more info about autostart.  Here you can learn howto login with ssh keys instead of passwords.

I realize it looks hard but its very much worth the hassle. Once done you have transparent access to your remote files over an encrypted tunnel.

A GUI managing this would make Linux to Linux file interaction be a lot easier and above all much safer than most other systems. Copying SMB is a huge step backwars in my opinion.

No comments:

Post a Comment