sshfs - user and group permissions
David Fletcher
dave at thefletchers.net
Sat Jan 1 18:48:28 UTC 2011
I moved all the files that I use for word processing, spreadsheets etc.
to my server so that I can use them via sshfs from either my desktop or
my laptop, and also have an automatic, regular backup. That seems to be
working for me, but more by luck as far as I can tell.
The user ID numbers (the ones that start at 1000 on Ubuntu) of which
there are only 3 or 4, on the server have ended up not being the same as
the numbers on the desktops and the laptop. By coincidence mine is the
same but not my son's.
I wanted to set up a text file in /home/ on the server that can be
edited by either me or my son, so on the server I set:-
sudo chown me:son filename
sudo chmod 664 filename
which when connected by ssh into the server appears to correctly set the
file permissions so that either me (the owner) or my son (the group) can
edit it, but only I can edit and save it when either of us use sshfs to
connect to the server from the laptop and browse to the file with
nautilus.
I was expecting this to Just Work given that each of us is
authenticating ourselves with a server password, but obviously it
doesn't. Using nautilus to check the permissions on the file it appears
to be getting confused because the user ID numbers on the server are
different to the local numbers on the laptop, and when my son opens it
in gedit it fails to save. If I set
sudo chmod 666 filename
then it works, but not properly if you see what I mean.
Also, all my personal files in /home/me/Work/ on the server have been
set to user:me group:users presumably as I copied them over and use
them, which is not what I want.
Any ideas how to fix this, please? We tried using the idmap=user option
to mount, which I thought looked like it might help but it didn't.
Dave
More information about the ubuntu-users
mailing list