2

I mounted a remote with SSHFS and everything works as expected, except the owner/group information. No matter what file's owner/group I check, it's always root:root.

I'm mounting the remote like this (in my fstab):

[email protected]:/var/www/clients/client1/  /mnt/ftp_remote  fuse.sshfs _netdev,user,idmap=user,transform_symlinks,identityfile=/root/.ssh/id_rsa,allow_other,default_permissions,uid=0,gid=0 0 0

Why is that? How can I make SSHFS show the correct file owner/group?

2 Answers 2

2

You can't. That's a limitation of SSHFS/Fuse: Everything is mapped to the permission of the user you use to connect with SSH by default.

However, it appears you can work around this a bit with idmap files, see the options -o idmap, -o uidfile, -o gidfile and -o nomap in the man page.

1

It is a 4 years post, but it will be shared to save someone else time. This result is correct: you connected to the server as the root user, using its credentials, hence all will be performed as root. This is identical to login with an user called foo, and create a file using it, all the created files will have the foo ownership, as also the foo user restrictions (eg. will be created only if this user has clearance).

If you do want to have a different permission it is necessary to perform the action with the target user. This is the suggestion:

**client1**@188.yyy.193.xxx:/var/www/clients/client1/  /mnt/ftp_remote  fuse.sshfs _netdev,user,idmap=user,transform_symlinks,identityfile=/root/.ssh/**client1_**id_rsa,allow_other,default_permissions 0 0

it is necessary to have the client1 username, and it shall have the ability to log.

You must log in to answer this question.

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