Short Tip: Mount directories via SSH

Other computers are often accessed via ssh. That is very easy and comes along with a lot of possibilities. However, working on files which are saved on the server is not that simple all the time. KDE offers the fish:// KIO for these cases, but this just works for KDE apps, and has to be called for each app individually.

In such cases it makes more sense to actually mount the server directories locally: sshfs let you mount any given server directory locally. And since it works on top of FUSE it does not require root interaction at all (given that the local user is a member of the fuse group).

All you have to do is:

sshfs -o idmap=user ~/sshDir

The idmap=user option translates the server side uid to the client side uid and is therefore an often used and also needed option to avoid permission problems.

Of course the given directories have to exist on the used machines. Also, as already mentioned, make sure that the user who tries to use sshfs is a member of the fuse group! Last but not least the server must have a running ssh server, and the program sshfs has to be installed on the client machine. On Fedora, the package is called fuse-sshfs and is part of the main repositories. I guess it is similar on the other, bigger distributions as well.

Since every sshfs directory is a regular fuse directory, the umount is done via:

fusermount -u ~/sshDir

This can even be embedded into /etc/fstab and also understands typical ssh configuration options like other ports or the very handy key authorization.

About these ads

5 thoughts on “Short Tip: Mount directories via SSH

  1. SSHFS is great, I use it almost all the time. Another good FUSE application is curlftpfs. Its not quite as seamless as SSHFS but its still pretty neat.

  2. Kevin, that’s great news. How does it come that the group is not needed anymore? Wasn’t there a security reason to have the dedicated group?

  3. Pingback: sshfs « Krümi

Comments are closed.