7

Let me start with giving you the details of my setup:

I am running Fedora 13 on an x86_64 arch. I have mounted a remote directory using sshfs:

jim@localsite $ sshfs jim@remotesite:/home/jim /home/jim/remotemount

Now if su to root and try to read the content under the mount point, I get:

root@localsite $ ls -l /home/jim/remotemount
ls: cannot access remotemount: Permission denied
root@localsite $ ls -l /home/jim
total 0
drwxrwx---. 1 jim jim      90 Oct 1 12:00 bin
drwxrwx---. 1 jim jim      90 Oct 1 12:00 dev
d?????????? ? ?   ?         ?           ? remotemount
drwxrwx---. 1 jim jim      90 Oct 1 12:00 tmp

Seeing that root cannot access the remotemount directory is rather odd. Is this expected behavior? If so, why? If not, any lead on how to go about fixing it will be helpful. Thanks.

2 Answers 2

12

This is by design in fuse as a security measure. Pass the -o allow_root or -o allow_other option when mounting the filesystem with sshfs.

It is in place to prevent from root from being nosy on shared systems.

4
  • 1
    Thanks - that's what I was looking for. Also, the line "user_allow_other" needs to be added to "/etc/fuse.conf" to allow using allow_root option. Commented Oct 8, 2010 at 6:54
  • What's to prevent root from simply logging in as the target user and bypassing the limitation? Commented Sep 26, 2022 at 21:40
  • Nothing stops root from using su/sudo to become a user. Root is root, It is all powerful. So the answer is, don't give root privileges to anyone that you don't want to have access. That setting isn't really intended to stop root though. It is more about making it so various scripts/tools/services that might run as root don't get that access by default. So it is more of a guardrail then a true limitation. Commented Sep 27, 2022 at 4:07
  • It's actually to protect root, not the user. Commented Jan 26, 2025 at 12:32
0

found ls: cannot access system: Permission denied after sshfs on mint/ubuntu.

sudo adduser <username> fuse

remove from comment user_allow_other in file /etc/fuse.conf. Change permission of fuse.conf sudo chmod a+r /etc/fuse.conf reboot now and do

sshfs <login>@<ip_of_machine>:<path_to_mount> <mountpoint> -o allow_other

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.