Automount Anything over SSH

0.00 avg. rating (0% score) - 0 votes

First, make sure you can use public key authentication or similar means to connect to ssh servers without typing in your password all the time.

Install sshfs for mounting remote filesystems over ssh, and afuse for automounting FUSE filesystems (sshfs uses fuse).

For dead connection detection, add this to your ~/.ssh/config:

That will ping the remote server every 30 seconds and detect a dead peer. This is needed for the sshfs reconnect option to work properly.

Create a directory where to automount your remote filesystems:

Now ask afuse to automount any server you ask for under that directory:

Now, go to the sshfs directory and cd to some server you know you can log on to:

If your authentication to works, you should now be able to list the root directory there.

Add that afuse command to somewhere where it will be executed when you log in, like ~/.xsession, and you’re done. Or use the gnome-session-properties tool or similar.

This should work for other FUSE filesystems, but I haven’t yet tested them.

Leave a Reply