Can't create a common directory for family members

I’m running Ubuntu 25.04 on my home machine and have administrator privilege. I want to create a ‘common’ directory where others using the machine can access all the files in the common directory. I have read multiple threads on 'how to" do it, but family members can never copy to the common directory. The latest attempt:
$ sudo groupadd Family
$ sudo mkdir /home/Common
$ sudo chgrp Family /home/Common
$ sudo chmod 770 /home/Common
$ sudo chmod +s /home/Common
$ sudo usermod -aG Family sandy
$ sudo usermod -aG Family john
$ sudo usermod -aG Family andrew
$ sudo ln -s /home/Common /home/sandy/Common
$ sudo ln -s /home/Common /home/john/Common
$ sudo ln -s /home/Common /home/andrew/Common.

The Common directory shows up in everyone’s home directory, but when I’ve tried to copy a file from a usb drive to Common I get access denied. What didn’t I do right?

If snap based apps are involved you may try to bind mount folder ‘Common’. To test this for one user remove the symbolic link, create a folder and bind mount (man mount) the shared folder. If this works you need to add one line to /etc/fstab to make this permanent.

sudo rm /home/john/Common
sudo mkdir /home/john/Common
sudo mount --bind /home/Common /home/john/Common

Now test if this is working.

1 Like

No apps involved, but tried suggestion anyway and got error ‘access denied’, when tried to copy files. So, logged in as root admin and retried. Got same result.

Firstly just to be absolutely sure, can you copy from the the usb drive to /tmp ?

I guess by now you have logged out and logged in.
Can you make a directory in /home/Common?
Can you copy a file from your home directory into /home/Common?
Try making Common somewhere else, such as creating /opt and making Common it there (so /opt/Common), just in case apparmor is protective of /home

One more question: how do you copy the file?

I left click on file on the USB drive and use ‘copy to’ command. Also tried to open a Libre office doc and to save it to Common. All resulted in Access Denied.

Did you also check the questions of @timatgca? In addition: are you allowed to copy directly to /home/Common?

Similar old post by BoneKracker back in 2010 with details & explanations.

3 Likes

Have you rebooted/ logged-out & logged-in again?

I ran your commands in a container, swapping out sandy, john and andrew for the user ubuntu.

$ ls -l /home/Common /home/ubuntu/Common
lrwxrwxrwx 1 root root     12 May 22 20:30 /home/ubuntu/Common -> /home/Common

ls: cannot open directory '/home/Common': Permission denied

$ sudo reboot now

Broadcast message from root@keen-ewe on pts/3 (Thu 2025-05-22 20:31:47 UTC):

The system will reboot now!

# REBOOTED HERE

$ ls -l /home/Common /home/ubuntu/Common
lrwxrwxrwx 1 root root     12 May 22 20:30 /home/ubuntu/Common -> /home/Common

/home/Common:
total 0

$ touch /home/ubuntu/Common/something

$ ls /home/ubuntu/Common/
something

As you can see, once relogged-in, access is permitted

Sorry all for this tardy reply, but I’ve been trying all of the above suggestions as time permits. Right now, I’ve deleted the ourfamily group and the family directory and starting over as the root-user. Are there any changes to any of the above when creating a shared folder?

I use the “Copy to” command.

As a new ubuntu/linux user how do I even “copy to” a folder that is not even listed on the “copy to” screen?

I agree with what @oldfred suggested.

I am running Ubuntu 25.04 on an Asus Videobook that was running Windows 11. I have three accounts on my computer. One has admin privileges. the other two users are my wife and I. I have been trying to create a directory that is fully accessible to my wife and I. I have asked how to do this here and have read numerous responses. I have tried each one from the terminal as both the admin and as the root (using su command). So far I have been able to create a directory that is visible to both my wife and I but cannot “c:opy to” or “move to” it.

If anyone has succeeded in this effort, please give me a copy of the terminal commands that you used.

In a VM, I created two non-admin users, husband and wife.
then I created a directory in /opt

cd opt
sudo mkdir shared_local
#create a group:

sudo groupadd family

#change permissions
sudo chgrp family /opt/shared_local
sudo chmod 2770 /opt/shared_local

# the symbolic equivalent to 2770 is
sudo chmod u=rwx,g=rwx,o=,+s /opt/shared_local
# The `setgid` bit ensures new files/directories created within `/opt/top/shared_local` will have their group set to `family` .
# assign users to group
sudo usermod -aG family wife
sudo usermod -aG family husband
# test
sudo su wife
touch /opt/shared_local/hello_world.txt

ctrl D to exit, then log in as husband and try to edit that empty file


sudo su husband
echo "Love you" >> /opt/shared_local/hello_world.txt

ctrl D, then login as wife and have a look

Note that I tested gemini-2.5-pro
with

I want to create a group called family, assign non admin users “wife” and “husband” to it, and give the group full permissions on a directory /opt/shared_local

and it was accurate although it went for the numeric permission 2770 which is not very clear.
I have a basic ubuntu system admin prompt for that:

"Using Ubuntu 24.04 or later. Provide expert system administration help. If the answer is a bash script, include one line solutions. Python is a good choice for system admin scripts as well. Explain advanced techniques, and show how to test and undo changes as part of the answer. For a text editor, use vim and assume moderate skills and experience with it. Always use markdown syntax for code including python and bash or shell scripts and commands."

2 Likes

This link into the Ubuntu Desktop Guide might solve the ‘how to copy’-problem. The ‘copy-to’ menu-item is just a short-cut to targets the developers of the file manager expect to be regular targets for copy operations …

On the command line the copy command is ‘cp’ and the move command is ‘mv’. Both expect the file(s) to operate on followed by the target (either a filename if there is only one file given as source or a directory if you give multiple files). Examples:

cp /home/me/Documents/MyFile.odt /media/me/BigUSB/texts/newfile.odt
cp /home/me/Pictures/passport.jpg /home/me/Pictures/scans/Certificate.png /media/me/smallStick/

Yes! This works. Used sudo ln -s opt/ourstuff /home/wife/ourstuff and ln - s /opt/ourstuff /home/husband/ourstuff so ourstuff directory (the shared directory) appears in both home directories. All good. Can right click on a file in another directory and “Copy To” ourstuff, but cannot use “Move To.” Also cannot use any of the “Save” commands in LibreOffice to save a doc in ourstuff as ourstuff doesn’t appear in the list of available directories. Any Idea why the directory is not included in the list?

Any Idea why?

Possibly the directory is not appearing due to snap sandboxing of Libreoffice, if you have the snap version. I don’t know how to change that.

I use the flatpak Libreoffice. I just make a quick check: a link to /tmp, and it appears.

In case of snap apps you may need to bind mount the folder as mentioned in post #2.

sudo rm /home/wife/ourstuff
sudo mkdir /home/wife/ourstuff
sudo mount --bind /opt/ourstuff /home/wife/ourstuff
sudo rm /home/husband/ourstuff
sudo mkdir /home/husband/ourstuff
sudo mount --bind /opt/ourstuff /home/husband/ourstuff

These bind mounts aren’t permanent and will be lost on reboot. If this works you need to add two lines (one for each bind mount) to /etc/fstab to make them permanent:

/opt/ourstuff /home/wife/ourstuff none rw,bind 0 0  
/opt/ourstuff /home/husband/ourstuff none rw,bind 0 0  

Moving a file to/from your ~/ourstuff directory may not work if you do not have permission to delete/create the file in source/destination location.

1 Like

Here’s something you can try, if you are using snap and it’s causing problems. This may or may not help.

you can install these snap management apps:
sudo snap install desktop-security-center
sudo snap install prompting-client

two things will happen.
First, if you were to install the snap libreoffice again, after removing it, you should get a dialog like this attachment, asking about permissions. By allowing access to everything, maybe it will work. In my case, I can access /tmp via the symbolic link I created. [but whoops I only gave read permission]

Screenshot from 2025-05-28 13-58-31

--------------------------------------------------------------------------------------------------
  • Secondly, you get a new app called Security Center, which offers some options for installed snap apps (the desktop ones, or some of them, they might need to somehow support this configuration tool); libreoffice appears in the list after I installed the snap).

NOTE: I should have granted write access, not just read access

It showed me the rule for libreoffice allowing access to everything (due to the way I answered the prompt in the screen shot)
If I remove that rule, I guess I go back to a default snap install.
In this case, I can no longer access my link to /tmp

So I think this solves it.