3

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?

4
  • Title says does not request password, body says does. Can you fix the question to make it clear. Commented Jun 5, 2016 at 11:22
  • @richard, sorry, indeed, the title was wrong. Thanks
    – Fluffy
    Commented Jun 5, 2016 at 11:29
  • 1
    This should not be closed as "can't be reproduced". The question clearly shows the sshfs# prefix (which the answer states is the issue). Prefixing the line with sshfs# is common for fuse mounts, and is in numerous documents on the web: goo.gl/b1d6Gd goo.gl/ilhqjw
    – phemmer
    Commented Jun 9, 2016 at 4:42
  • @Patrick: Well, I guess they closed it because the problem "went away when a typo was fixed". My understanding of that close reason is that it's meant for monumentally stupid typos, like "Why is the system saying muont not found?" I believe that this solution to this problem is likely to help future readers, so I'm voting to reopen. Commented Jun 9, 2016 at 5:20

1 Answer 1

3

The problem was with the sshfs# part in fstab, apparently it's passed to ssh as-is, and it presumably searches for id_rsa of that missing user. After I've removed sshfs# it worked fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .