Automatically reconnect sshfs
Posted: 2020-06-10 Filed under: system | Tags: reconnect, ssh, sshfs, thunar Leave a commentI’ve been using sshfs to mount a remote folder between computers in my home networks. Sometimes I switch from WiFi to wired connection or the other way around. This causes Thunar to freeze, if I had forgotten to unmount the remote folder. Which I almost always forget to do and it becomes quite annoying.
I searched for a solution and found these two relevant posts. So, now I mount the remote folder as follows:
sshfs username@IPADDRESS:/tmp /media/hd1/ -o allow_other,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3
Now, if the connection is interrupted, I get a window to retype my SSH password.