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.
email@example.com:/owned_by_root /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?