Creating directory that is visible to other users on machine

Totally new to linux. Coming from windows 11. Copied folders from windows onto usb pendrive then replaced windows with Ubuntu 25.04. Would like to create directories corresponding to windows folders that are visible to the other two users of machine when they log in. Do I create such directories in /root? or what? Also, kindly comment on any element of my post…so I can learn how to ask questions properly.

We need some more information to better help you.

  • is everyone logging in using the same user account and password or will there be 3 separate user accounts, with their own logins?
  • when you say “visible”, do you want them to have read and write access or only access to view the content of the files?
  • “corresponding to windows folders” in other words folders like Documents, Pictures etc.?

No, definitely not.

/root is the home directory of the root user (the superuser), and is/should be only accessible to the root account.

When you set up Ubuntu and created an account with password, this allows you to use sudo which gives you elevated root-like privileges but only for a limited time.

Sharing root privileges is potentially dangerous and should not be given to ordinary users.

In principle, you can organize directories where you want, but it is good practice indeed to follow the Linux file system conventions. A good place to set up your common directory is under /home, next to the user directories, e.g., /home/shared.

Then, you will need to set up appropriate access by setting appropriate Linux permissions and ownership. If you want all users to have full red and write access, but still want to keep things somewhat secure, you will need to create a common group, e.g. share. Then have the shared directory owned by that group. Owner and group are then given read and write permission. Moreover, the setgid bit is set, such that any new file created in that folder inherits the group of that folder, and not the standard group of the user.

With the terminal, this can work like:

sudo groupadd shared            # add group "shared"
sudo mkdir /home/shared         # create directory to share
sudo chgrp shared /home/shared  # make directory owned by group "shared"
sudo chmod 2770 /home/shared    # set 'setgid' bit and read/write/execute permissions for users and groups
sudo usermod -a -G shared user1 # Add an existing user, user1, to the group

Optional: For easy access, you can create a symbolic link in each of the user’s folders:

ln -s /home/shared /home/user1/shared

Thus, the user sees the folder “Shared” in his home directory, providing immediate access without having to leave the home folder.

1 Like

That makes sense. Thanks! Now, some of the windows folders on my usb drive have sub folders (e.g., FAMILY has subfolders: Art, Photos, Vacations, et al.) Do I need to create sub-directories under home/shared for each of those windows subfoldes, or is there a way to copy the parent window folder into the home/shared directory from the usb drive and have sub-directories automatically created?

BTW, I’m running an Asus Vivobook as a home/family machine and want only my family members to have access. Each of them have their own accounts and passwords., I set them up with their own home directors that only they have access to.

Well, I spoke too soon! Got down to creating the symbolic link step and…

andrew@Asus:~$ sudo usermod -a -G Misc sandy
andrew@Asus:~$ ln -s /home/Misc /home/sandy/Misc
ln: failed to create symbolic link ‘/home/sandy/Misc’: Permission denied

Need a bit more help.

BTW, Running Ubuntu 25.04 and name of folder I want to share is obviously Misc.

Prefix that with sudo

sudo ln -s /home/Misc /home/sandy/Misc

Mine:

stat /home/shared 
  File: /home/shared
  Size: 3         	Blocks: 2          IO Block: 131072 directory
Device: 0,61	Inode: 827472      Links: 2
Access: (2770/drwxrws---)  Uid: (    0/    root)   Gid: ( 1001/  shared)
Access: 2025-04-24 11:02:58.598036537 -0600
Modify: 2025-04-24 11:05:17.448462534 -0600
Change: 2025-04-24 11:05:17.448462534 -0600
 Birth: 2025-04-24 11:02:58.598036537 -0600

1 Like

Note that this setup will not work for snaps (i.e. Firefox), you will need to use a bind mount, else apparmor will refuse access since it can not verify the security/integrity of the target directory…

1 Like

DAH! Of course!

Ok, that worked. Got directories visible in all machine users’ home pages. But when they try to open folders, it asks for their password. Since they’ve already logged into their account, why does it ask for their password again? Is there a way to make it so they don’t have to log in twice to open and see what’s in the shared directories?