I have added a following line in fstab:
sshfs#[email protected]:/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 [email protected]
as root, I don't get asked for password.
Also, when I run:
sudo sshfs -o allow_other [email protected]:/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: goo.gl/b1d6Gd goo.gl/ilhqjwmuont not found
?" I believe that this solution to this problem is likely to help future readers, so I'm voting to reopen.