I've been working on setting up a home fileserver for my family. I use samba over the LAN and SSHFS for anyone connecting via the internet. So far samba is working perfectly and SSHFS works, but files created/copied with SSHFS have the wrong permissions. I have a separate partition where files are stored with a structure like:

User A
User B

I use ACLs so that the different users can see and access but not change files in each other's folders, but everyone can see and edit files in the Shared folder. Additionally, I have set the ACL defaults such that any folders and files that are created or copied into the folders on the server inherit the proper permissions. This works fine with samba, but when I connect via SSHFS any files created or copied to the server keep the client's permissions.
Is there an option to correct this when I mount the server's drive via SSHFS? Or does SSHFS simply not support ACLs? If the latter, is there a workaround/patch/alternative?

Thanks in advance, and let me know if you need any more information.

Additional information:
All users have local (on the server) accounts
All users have the same primary group
All users can connect via SSH and SSHFS with public keys
With samba, if a client folder has, say, drwx------ permissions and I copy it to the Shared folder, it's permissions (for the contents as well) will be changed to drwXrwXrwX (which is what I want), and if copied to a User file they will change to drwXr-X---

Tried switching back to passwords instead of public keys for SSH and SSHFS as per GaryBishop's suggestion.


I had a similar problem with AFS. Perhaps my solution will work for you.

If I logged in to the remote system using a public key, I didn't get a token and thus ACLs did not work. But if I logged in with my password, I got the token and everything worked.

SSHFS, is just logging in using SSH. I set things up to require a password when connecting with SSHFS and my issues went away.

To test this, simply login with SSH and see if the ACLs work properly.

|improve this answer|||||
  • Thanks for the suggestion. I tried switching back to using passwords instead of public keys for SSH (and therefor SSHFS), but still the permissions are incorrect. Any other suggestions? – Chris Nov 30 '12 at 15:24
  • I suggest you figure out how to get them right when you login with SSH. You'll have a ton more control that way. Once you work that out, perhaps you can apply that to SSHFS. – GaryBishop Nov 30 '12 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.