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.

Mansour
  • 499
  • 2
  • 7
  • 14

2 Answers2

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.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • 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. – Mansour Oct 08 '10 at 06:54
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
djsharma
  • 1
  • 1