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: posix-rename@openssh.com <1>
Extension: statvfs@openssh.com <2>
Extension: fstatvfs@openssh.com <2>
Extension: hardlink@openssh.com <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

Blub
  • 133
  • 1
  • 4
  • Take a look at the sshd's log on the remote host. – quanta Dec 06 '11 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`. – Vytenis Bivainis Sep 28 '14 at 22:33

3 Answers3

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 developer@dev.server2.example.net:/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.

angelcool.net
  • 296
  • 3
  • 13
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.

Peter Grace
  • 3,456
  • 1
  • 27
  • 43
0

root@XXXXXXXXXXXXX

Probably because you are logging in as root?

Tim
  • 3,017
  • 17
  • 15