Timeout when sshfs mount not reached

I understand you quite well - I have been there … I know exactly what you are referring to …

@Mirdarthos already linked you to the solution - the articles I wrote are battle tested - and they work.

You can create a system service to do the lifting - it will mount when you access the mountpoint - detach yourself from the thought that fstab is the only way.

Comment the entry in fstab and mount the share before you test below suggestion.

/etc/systemd/system/mnt-sftpshare.mount

[Unit]
Description=sftp share on 192.168.168.2

[Mount]
What=username@192.168.168.2:/
Where=/mnt/sftpshare
Type=sshfs
Options=_netdev,auto,IdentityFile=/username/.ssh/keyfile

[Install]
WantedBy=multi-user.target

/etc/systemd/system/mnt-sftpshare.automount

[Unit]
Description=sftpshare on 192.168.168.2

[Automount]
Where=/mnt/sftpshare
TimeoutIdleSec=10

[Install]
WantedBy=multi-user.target
sudo systemctl enable --now mnt-sftpshare.automount
1 Like