Mounting a remote system with SSH

One of the cool things I’ve been doing lately is using secure shell to mount remote file systems. The great thing about this method is that you’re not dependant of explicitly creating shares as you are in Samba, and you don’t have to rely on repeated scp commands.

As long as you have the sshfs package installed, you should be able to mount the file system. Here’s an example to create a mount point on your desktop:

<code>mkdir ~/Desktop/sshmnt
sshfs user@target-pc:/home ~/Desktop/sshmnt/</code>

That’s it! Once finished you can unmount the folder with the fusermount command:

<code>fusermount -u ~/Desktop/sshmnt</code>

If you have trouble with unmounting a connection (because the target may be switched off), you can force the connection to be unmounted:

<code>fusermount -z -u ~/Desktop/sshmnt</code>