0

I created three accounts as follows;

sudo adduser Edwin
sudo adduser Mike
sudo adduser Brian

Now I would like share a folder between these three accounts so if Mike downloaded an image or a document into the folder, Edwin and Brian can see it and be able to modify it.

All help would be highly appreciated.

1
  • 3
    Welcome to Raspberry Pi! The linked answer suggests that your question is a general Linux question not specific to the Pi and is thus bordering being off-topic. Please take the tour and check the helpcenter.
    – Ghanima
    Commented Feb 13, 2016 at 10:39

2 Answers 2

6

You will have to add those users to a group, and then have that group own the directory. The process is outlined in this Superuser post

1

If you want an user to be able to access a file or a folder, you need to set the correct permissions for it. First of all, you need to create a specific group for the three users.
Do it like so : groupadd mygroup where mygroup is the name of the group, for instance sharingUsers.
Then, you need to add your users to the group : useradd -G mygroup user where mygroup is the group you've just created above. Replace user with the user you want to add to the group. In your case, run the command three times with Edwin, Mike and Brian.

Then, make sure the file's owner is one of the user in the group you've creating. Use chown the change the ownership of a file or folder (assuming that your file is called myFile). So you would do chown Edwin myFile.

The permissions are set up with the command chmod. In your case, you would do chmod g+rw myFile. This changes the permissions for the group the file owner is in (g). The + adds permissions and rw stands for read and write. If you want the users to be able to execute the file, use +x.


To change a file permission for just one user, use chmod u+rwx myFile. This will add all the permissions to the user owning the file.

(Note : Never copy commands from website, type them yourself)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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