37

I and my brother have User Accounts on this machine. I want to share the Documents directory with him.

Is there a STRAIGHTFORWARD way to do it?

I am not a power user so I am looking for a way to do this using nautilus, rather than a script or a way that requires creating symlinks.

I can download an application if i have to.

Last time I wanted to do this I just copied the contents to /home for both of us to use.

Something I can do in System Settings would be appreciated

Zanna
  • 72,312

3 Answers3

21

Updated for Ubuntu 24.04

There are three/four steps to this process

Step One: Make your brother a member of your group.

Your group-name is same as your user-id. Say, if your user-ID is akumar your group name is also akumar. If your brother's ID is bkumar, then you want to make bkumar a member of the group akumar.

  1. Install the app Gnome-System-Tools with the command: sudo apt install gnome-system-tools.
  2. Search for and click on the app Users and Groupsenter image
description here
  3. The Users Settings window will open. Select your user, akumar on the left panel. Then click on the box Manage Groups below the list of users.enter image description here A new window called Groups settings will open. enter image description here
  4. Scroll down and double click the group name of your brother bkumar.enter image description here As in the above picture, verify the Group Name is "bkumar". Check the boxes for both "A Kumar", and "B Kumar" under Group Memebers. Click OK.
  5. Make the same changes for the Group bkumar, and make sure both akumar and bkumar are members of this group.

Now you have added the brother's group bkumar to your own username akumar. Alternately you can use the command:

sudo usermod -a -G bkumar akumar  #Adds the group bkumar to the user akumar
sudo usermod -a -G akumar bkumar  #Adds the group akumar to the user bkumar

See How to manage users and groups using GUI? for more on adding a group to user username.

Step Two: Change the permission of the folder you want to share. Here I assume you want to share your Music folder with your brother`bkumar.

  1. Open Nautilus also known as Files. Right click on the folder you want to share (Music). Click on Properties.enter image description here

  2. Go to permissions at the bottom of the window.enter image description here

  3. The Set Custom Permissions window will open.enter image description here As you can see the group is set to `akumar' and Access is set to "Access Files".

  4. Change the Group to `bkumar' and Access to "Create and Delete Files".enter image description here

    look for the group permissions and change it into "Read and Write." Check the box for allowing the same permissions to the files and folders inside.


Step Three: Verify that your brother can create delete files in the shared folder.

  1. Let your brother login to the computer or login to your brother's account.
  2. Open Nautilus, AKA Files. It will open to your brother's home folder. Open your brother's Music folder.
  3. Open another Nautilus window.
  4. click on Other Locationson the left panel. Then click on the Ubuntu disk icon.enter image description here
  5. Double click on home folder.enter image description here
  6. Double click on folder named akumar inside home.enter image description here

Copy a file from B Kumar's music folder to A Kumar's music folder.enter image description here

Step Four: (optional) Make a link of A Kumar's Music folder to your brother B Kumar's home folder.

The GUI method of creating a symbolic link is disabled in Nautilus by default. Use the following command:

ln -s '/home/akumar/Music' '/home/bkumar/As Music' 

Change the usernames and folder-names according to your needs.

Alternately see How do I create a link to a file in Ubuntu 23.10? and enable Make Link in files. Once enabled you can create a symbolic link of akumar's Music folder in akumar's home by right clicking on the Music folder and selecting Make Link from the context menu. Then move that link to bkumar's home folder.

Hope this helps

user68186
  • 37,461
13
sudo mkdir /shared
sudo chmod a+rw /shared

Now everyone can see and edit the /shared folder. Feel free putting files there and everyone will be able to access this folder and share files between users.

11

I would recommend the following solution: - Create a group for sharing, just call it "shared". - Add all users who should have access to the shared files to this group. - Create a directory outside of users homes, e.g. /shared for shared files. - Change group of this folder to the group for sharing and adjust group permissions. - Set group sticky bit for this shared folder.

Advantages of this solution: - Every file you copy into this folder automatically gets the shared group, so every user who is a member of this group can access these files without any additional effort. - You still can have your private files outside this folder with your personal group which are not accessible by other users as long as they cannot get root and they cannot boot with another Linux OS. But keep in mind: If you want to have real privacy then you have to use encrypted folders/files.

I'm wondering why Linux distributions still have no common solution for this problem, because nearly everyone is concerned.