I'm automounting sshfs shares using a script in /etc/network/if-up.d/ and entries in /etc/fstab. I have keys set up for my user so no password is required.

My user (1000) has sudo rights on the server. (User ID's are the same on both computers too.) Root login via SSH is not permitted on the server. I need to mount a directory and access the files in it as root. I'm not sure how to do that with sshfs.

I added allow_root, as shown below, but that didn't help.

sshfs#user@ /xyz/owned_by_root    fuse   comment=sshfs,noauto,nonempty,users,exec,uid=0,gid=0,allow_root,reconnect,transform_symlinks,BatchMode=yes 0 0

I also tried uid=1000 and uid=0. Neither works as expected. With uid=1000, the directory is mounted, but I cannot view any files due to permissions (even when I am root on my local machine). With uid=0, I don't think the directory is mounted at all (probably because the key is for user 1000).

My question: How do I get behavior similar to NFS with no_root_squash where I can mount it in a way that allows me to browse files and subdirectories owned by root when I open a local file browser as root?

closed as too localized by Seth, user25656, hhlp, rɑːdʒɑ, Eliah Kagan Mar 2 '13 at 22:42

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • This question appears to be abandoned and unanswered, could you perhaps add more detail to your question? If this question no longer applies then you can either delete it or answer it yourself if you've solved the problem. If you are still looking for an answer please let us know. Thanks! – Seth Mar 2 '13 at 4:55
  • This question is actually what is happening to me right now. I don't understand why it's closed. – Avio Jul 25 '18 at 10:33
  • You could try asking at unix.stackexchange.com. For example, see unix.stackexchange.com/questions/423556/… for info about a relevant SSHFS bug. – MountainX Jul 26 '18 at 2:15