Just learnt about afuse, a userspace automounter. It’s possible to have sshfs mounts automatic with autofs, but this is executed as root, autofs can’t pop up SSH key passphrase dialogs for you, whereas afuse certainly can. I now run this
$ afuse -o mounttemplate=”sshfs %r: %m” -o unmounttemplate=”fusermount -u -z %m” ~/mnt/
on login and then to put something on any box set-up in my SSH config I
can just do cp file ~/mnt/hostname/
and it’ll connect up for me. Of
course you can use scp for this direction; clearly lots of other uses.
Very pleased to have discovered this useful little tool.