Shared directories?

Oh yes, should have read it better.

Actually I have some hard time getting it to work smoothly. Login is the first problem with many same names in the list, hard to know who is who.
And is asks for passwords which I set differently for new users, and now it is hard to know which password to use.
Fortunately I tested it in a spare VM…

Yeah, I was thinking the passwords at login might be an issue. I’m also still curious as to whether this means both users have the same directory under /home. If so, then I don’t think this would be the ideal solution, as part of the appeal of mutliple users is keeping all the dotfiles separate. This is why I was interested in soft-linking the data directories (Documents, Music, etc) but still having separate user directories under /home.

You still have the alternative to use the same group with both users (that have different user id). Something like:

  sudo useradd -m -g "existing-group" "new-name"

where you replace “existing-group” and “new-name” appropriately.

Yes, separate home directories and passwords.

Never thought about sharing the same uid. Wouldn’t want to do this even if it solves the sharing problem, though. :thinking:

With standard permissions you’ll eventually run into problems when users create subfolders and files in each others (sub-)folders or copy files from outside the shared folder into it.

:bulb: The solution to your sharing issue is using ACLs (Access Control Lists). These are additional sets of file permissions on top of the normal owner, group, and other permissions.

Example: Let’s say you’re a family of four: dad, mom, kid, grandpa.
Now, if you want mom and dad to have full read/write access to a pictures folder, regardless of who created or modified the files, but kid should only be able to read and not add/edit/delete any files and grandpa shouldn’t even be able to access the folder, you can set this up with acl’s.

Here’s some starter information; a combination of the info in the following sites should help you set up according to your needs:

https://wiki.archlinux.org/index.php/Access_Control_Lists

in German:
https://www.knilse.de/download/acl.html


Disclaimer: It works! I’ve set this up on my systems that share users. I first tried to share a playonlinux/wineprefix (steam) folder between two users in 2010 because I didn’t like steam installing a game twice in one system (Does Steam still do this?). It’s a pain to do though. Lot of trial and error involved. At least for me :crazy_face: . I haven’t played around with acl’s for a couple of years and have forgotten all about it … :frowning_face:

I usually stick to the command line, but in this case I found it fruitful to also use a gui-tool called Eiciel, which can be installed with yay -S eiciel

If you want to be able to edit a file/folder’s extended attributes and permissions with Eiciel by right-clicking in Thunar …

Summary

run …
leafpad ~/.config/Thunar/uca.xml

add the following …

<action>
	<icon>document-properties</icon>
	<name>ACL - Extended attributes...</name>
	<unique-id>1591531856441579-1</unique-id>
	<command>eiciel %f</command>
	<description>Edit extended attributes and permissions</description>
	<patterns>*</patterns>
	<directories/>
	<audio-files/>
	<image-files/>
	<other-files/>
	<text-files/>
	<video-files/>
</action>

Tip: You can backup and restore file and folder permissions easily.

Backup permissions of all the files and folders in path /home/shared to a file called home_shared.acl …
sudo getfacl -p -R '/home/shared' > home_shared.acl

If you mess up and want to restore the old permissions, just run …
sudo setfacl --restore=home_shared.acl