Automatically reconnect sshfs

I’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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s