I'm trying to use sshfs as a filesystem with encrypted communication. It mostly works, but I'm having some problems related to users/groups.

Since I need any user to be able to access the whole remote filesystem, and my root user to be able to change permissions and ownership of any file if necessary, etc., I connect using the remote's root user and use the allow_other option:

sshfs root@remote:/ mountpoint -o allow_other

It works, for the most part, but it causes the files that I create to be owned by root, which is the remote user. If I add the option uid=<userid> then the files are created by my user, but if other users in the system access it, the files they create will still be created by my user. Furthermore, this option hides the actual owner of the remote files when I list them, listing them all as myself.

I've tried the option idmap=user but all that did was list the files owned by root in the remote as if they were mine, so that didn't work either.

Is there a way to make it behave like a normal filesystem, with respect to how users are handled?

Failing this, I'd like to know what other alternatives there are, that use encrypted communication and respect uids and gids. The data on the other end is not encrypted nor should it be.

Your Answer

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

Browse other questions tagged or ask your own question.