3

this is the command:

pc@linux-vhvu:~> sshfs -o nonempty -o sshfs_debug root@XXXXXXXXXXXXX: ./dg
SSHFS version 2.3
Password: 
Server version: 3
Extension: [email protected] <1>
Extension: [email protected] <2>
Extension: [email protected] <2>
Extension: [email protected] <1>

Flow of events:

Formerly I tried the same thing with a different folder called "remote". It errored out, and said

fusermount: failed to access mountpoint /home/pc/remote: Permission denied

Then I tried with a new folder, because for some reason the permissions of ./remote changed to root...but the same thing happened to ./dg!

drwx------ 1 root root 4096 Oct 29 06:19 ./dg

2
  • Take a look at the sshd's log on the remote host.
    – quanta
    Dec 6, 2011 at 14:40
  • Good question. I wondered why, having user@host:/ /mnt/host/root fuse.sshfs noauto,users,reconnect,IdentityFile=/home/user/.ssh/id_rsa 0 0 in /etc/fstab, user can mount, but only root can unmount (umount) directory because of umount: root: Permission denied. But now i know, that's because sshfs changes the owner of root to root. Sep 28, 2014 at 22:33

3 Answers 3

3

When you mount a filesystem to a directory, the mountpoint assumes the permissions of the mounted filesystem's top directory. So, check to be sure that the permissions are proper on the target filesystem on the far end as well.

4

I ran into the same issue. The solution that worked for me was setting the uid and gid as follows:

sshfs -o uid=1000 -o gid=997 [email protected]:/usr/share/nginx/ dev.server2

That will set the mount point and everything inside to 1000:997 which are the actual IDs in the remote server. Locally my id is also 1000 so I'm still the owner. Hope it helps.

0

root@XXXXXXXXXXXXX

Probably because you are logging in as root?

You must log in to answer this question.

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