I have added a following line in fstab:
sshfs#root@1.2.3.4:/root/dir /home/dir fuse.sshfs defaults,_netdev 0 0
When I try to mount it with mount -a, I get a password request, even though I've added id_rsa.pub of root to authorized_keys of the server to connect to, and when I run ssh root@1.2.3.4 as root, I don't get asked for password.
Also, when I run:
sudo sshfs -o allow_other root@1.2.3.4:/root/dir /home/dir
It connects fine. I'm doing this as root user, so the problem obviously isn't that ssh runs as root, but ssh key is of some user.
Why doesn't sshfs use the key?
sshfs#prefix (which the answer states is the issue). Prefixing the line withsshfs#is common for fuse mounts, and is in numerous documents on the web: https://goo.gl/b1d6Gd http://goo.gl/ilhqjw – phemmer Jun 09 '16 at 04:42muont not found?" I believe that this solution to this problem *is* likely to help future readers, so I'm voting to reopen. – G-Man Says 'Reinstate Monica' Jun 09 '16 at 05:20