Fstab fuse.sshfs mounting during boot fails (Centos 8)

Contents in the /etc/fstab for the fuse.sshfs:

USER@server7:/home/USER /mnt/server7 fuse.sshfs defaults,allow_other,_netdev,uid=1000,gid=1000,idmap=user,reconnect,IdentityFile=“/home/user/.ssh/id_rsa” 0 0

Results during booting the system:

$ journalctl -x | grep server7
Oct 17 17:22:41 vatcad3 systemd[1]: Mounting /mnt/server7…
– Subject: Unit mnt-server7.mount has begun start-up
– Unit mnt-server7.mount has begun starting up.
Oct 17 17:22:44 vatcad3 systemd[1]: mnt-server7.mount: Mount process exited, code=exited status=1
Oct 17 17:22:44 vatcad3 systemd[1]: Mounted /mnt/server7.
– Subject: Unit mnt-server7.mount has finished start-up
– Unit mnt-server7.mount has finished starting up.
Oct 17 17:22:45 vatcad3 systemd[1]: mnt-server7.mount: Succeeded.
– The unit mnt-server7.mount has successfully entered the ‘dead’ state.

Mounting after xwindow login:

[user@vatcad3 ~]$ ls /mnt/server7/
[user@vatcad3 ~]$ sudo mount -a
[user@vatcad3 ~]$ ls /mnt/server7/
Music …

The /etc/fstab seems to work with the ‘mount -a’ later, after the boot and xwindow login is done, but it did’nt seem to work in the boot sequence.

You can try to add the option _netdev to indicate that this file system should be mounted after the network is ready. If it works or not, I don’t know, as I haven’t tested this.

Is there some ‘typo’ in my /etc/fstab in regards of the ‘_netdev’ that I can not see?

Sorry, It is me that is blind.

Added sshfs

It looks that I finally got it working using ‘x-systemd.automout’ in the /etc/fstab as:
USER@server7:/home/USER /mnt/server7 fuse.sshfs defaults,allow_other,_netdev,uid=1000,gid=1000,idmap=user,reconnect,IdentityFile="/home/user/.ssh/id_rsa",x-systemd.automount 0 0

However there seem to be now different issue as users /home2 fail to login without password.
In /etc/ssh/sshd_config:
AuthorizedKeysFile .ssh/authorized_keys /etc/ssh/authorized_keys/%u
with /home2 users with their keys in the /etc/ssh/authorized_keys/%u seems to work for this issue.

1 Like