Centos – SSHFS on startup CentOS 6.3

centoscentos6sshfs

I edited the file /etc/rc.d/rc.local and added the following lines in order to mount a remote directory through sshfs at boot time:

su user -c "/usr/bin/sshfs -o idmap=user -o reconnect -o allow_other -o uid=500 -o gid=500  user@remote:/home/shares/allusers /home/user/mnt"

The problem is that is not mounting the directory on startup but when I execute this command manually after logging in everything works as expected an the directory is mounted.

Any suggestions?

Best Answer

Try adding

sshfs#user@remote:/home/shares/allusers /home/user/mnt" fuse defaults,idmap=user

to /etc/fstab

test it with mount -a if ok, reboot