AutoFS with SSHFS on Ubuntu 11.10

AutoFS is a convenient tool to mount remote filesystems automagically.

Installation:

sudo apt-get install autofs sshfs
ssh-keygen

Entire content of my /etc/auto.master:

/net    /etc/auto.sshfs --timeout=120 --ghost

Entire content of my /etc/auto.sshfs

Documents   fstype=fuse,rw,allow_other,IdentityFile=/home/username/.ssh/id_dsa  :sshfs\#remoteusername@192.168.1.1\:/var/Documents/
## or
Multimedia  -fstype=fuse,rw,nodev,nonempty,noatime,allow_other  :sshfs\#remoteusername@192.168.1.1\:/var/Multimedia/

Now set the correct permissions for the autofs configuration files:

sudo chmod 644 /etc/auto.sshfs /etc/auto.master

Resources

Comments