How can I, a regular user, share files with specified users in Linux

2

On a Linux (Ubuntu, although a non-distribution-specific solution is preferred) machine, I would like to give another user read and write access to some of my files. Neither of us is an admin, so we can't create a group. Can this be done?

Tom Future

Posted 2011-10-09T00:16:51.807

Reputation: 143

Is this another user on the same machine? Or a different machine on the same local network? Or is the user somewhere across the Internet? – Mike Rowave – 2011-10-09T14:38:08.333

If you don't need a "real" bidirectional share, the recipient of the files can create a "drop box" folder with write-only permissions into which you can copy the files he wants to get. – Daniel Beck – 2011-10-09T15:44:21.680

Answers

4

Check if there is a "getfacl" command.

If there is such command you are able to use ACL's. It is extension of standard privilages system. You are able then to run command:

setfacl -m u:username:rw filename

kaszynek

Posted 2011-10-09T00:16:51.807

Reputation: 241

This does seem to be exactly what I want, although unfortunately it's not available on this system. – Tom Future – 2011-10-11T06:03:48.753

0

Other than to rsync back and forth, I cannot think of a "good" solution. I'd recommend something like this:

  • User A -> rsync -> $userB/userA
  • User B -> rsync -> $userA/userB

Therefore you always have your copy. After that I'd "diff out" the files changed.

  • User A -> find userB/ -atime...
  • User B -> the reverse.

I wouldn't recommend giving immediate write permissions; I can imagine some file-locking issues.

I'd suggest a common NFS/FTP share somewhere else.

Franz Bettag

Posted 2011-10-09T00:16:51.807

Reputation: 239