I have a remote computer, and I mount its filesystem with sshfs to my local folder ~/user@host, like that:

sshfs user@host: ~/user@host

Works nice, but I want to implement "lazy" mount: i.e. I don't want it to be mounted at system startup, but I want it to be mounted just when I'm trying to open my local folder ~/user@host .

Probably there is some way to define like "filesystem hooks": just when user requests directory contents, some command should be executed. Is it possible?

2 Answers 2


I think you're describing autofs. Autofs mounts filesystems on demand, that is, when you try to access them. According to this Arch wiki page, it should work with sshfs. https://wiki.archlinux.org/index.php/autofs#FTP_and_SSH_.28with_FUSE.29

  • Thank you, it looks like exactly what I need (but I'll check later) Mar 22, 2015 at 14:45

Looks like sshfs has a -o delay_connect option now, which is hopefully much easier to deal with than setting up autofs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .