sshfs is not mounting automatically at boot, despite /etc/fstab configuration
Solution 1
I experienced the exact same problem after upgrading from Oneiric (where the automount worked fine) to Precise.
What solved the problem for me was adding the delay_connect option. In addition, I've been using the option "workaround=rename" already before, since Oneiric times. Not sure whether it is still needed today, but at least it doesn't seem to hurt.
My full /etc/fstab line is:
sshfs#user@host:/remote/dir /local/dir fuse delay_connect,idmap=user,uid=1000,gid=1000,umask=0,allow_other,_netdev,workaround=rename 0 0
You obviously would need to adapt user/group IDs to your own environment.
Solution 2
Also to complement all previous comments,
Make sure you allow non-root users to specify the
allow_other
mount option in/etc/fuse.conf
Make sure you use each sshfs mount at least once manually while root so the host's signature is added to the
~/.ssh/known_hosts
file.sshfs [user]@[host]:[remote_path] [local_path] -o allow_other,IdentityFile=[path_to_id_rsa]
Related videos on Youtube
Adeel Ahmad
Updated on September 18, 2022Comments
-
Adeel Ahmad almost 2 years
android
Asynctask
has been modified quite frequently between different API-levels. I'm developing an Application in which i've to upload images to FTP server. i want to do that in serialized order (images upload after one-another by one image upload per asyntask). I understand theSERIAL_EXECUTOR
andTHREAD_POOL_EXECUTOR
stuff, but i just want some clarity about what is the default behavior of asynctask ( my min. target API is ICS 4.0 ). if i simply execute say 10 asyncs' in a loop, will they go to thread queue and execute one by one or they'll just go parallel ?-
glibdud about 10 yearsEver get this figured out? I'm running into the same issue on an Ubuntu 14.04 64-bit machine.
-
Ad N about 10 yearsSeeing the popularity of this question, compared to the number of answers, I gave up the fstab approach. I decided to bite the bullet and learn how to use Automount, addressing the big picture problem. From my experience it was "the right choice". A good introduction to Automount can be found on the Ubuntu wiki.
-
hata almost 9 yearsIf you control threads by yourself, I think, directly using
Thread
class andHandler
class may be short cut. It will be all under your control!
-
-
Ad N over 10 yearsI think the "mount only when network ready" is already asked using
_netdev
, and changing withnoauto
would make it unable to mount at boot (only explicitly when using the mount command) -
Nicolas almost 10 yearsWorked for me without workaround=rename where it didn't worked before. So my only change was adding the delay_connect option, that definitely helped here! Thank you for this. Just wondering why _netdev is not enough here...
-
Adeel Ahmad almost 9 yearsthat was : async task Inside loop.
-
AJefferiss over 8 yearsCan you expand on the
delay_connect
option? Where's it added to? Edit your question to include some more information about it. -
Tony over 8 yearsYou add it in the fstab option list: sshfs#user@host:/remote /mnt/local fuse delay_connect,uid=1000,gid=100,umask=0,allow_other 0 0
-
Auspex almost 8 yearsThat works perfectly for me, too. @Nicolas, I believe the
_netdev
issue is explained in Tony's answer. The network may be up, but it still can't resolve the host. Obviously, using an IP address would solve that, but who wants IP addresses in their fstab? -
Jonathan almost 8 yearsFor what it's worth, somehow when I copy pasted this into atom, it picked up invisible characters that broke it. I had to remove those
-
Jonathan almost 8 yearsIt mounts okay but then I get: ls /backup: Input/output error
-
MountainX over 6 yearsThe allow_other mount option exposes an unresolved security bug in the Linux kernel: if the default_permissions mount option is NOT used along with allow_other, the results of the first permission check performed by the file system for a directory entry will be re-used for subsequent accesses as long as the inode of the accessed entry is present in the kernel cache - even if the permissions have since changed, and even if the subsequent access is made by a different user.
-
aSystemOverload about 6 yearsAdding 'delay_connect, workaround=rename' worked for me on Arch Linux. Thanks!
-
opinion_no9 almost 3 yearsdelay_connect option made the difference in Ubuntu 20.04.3 - Thanks a lot!! ("workaround=rename" was NOT necessary)