0

I am just messed up with users of Ubuntu. I just have two users of my system: father and son Now I want to have access to all of my son files. But not by using sudo. It must be automaticaly. Now i did that to my son home directory sudo chmod 777 son But when he will create any directory under his account then i have not access to this and again i need to do sudo chmod 777 (new create file by son)

How to avoid that ? How to create hierarchy that father is upper son and can automaticaly read his files without using sudo.

Notice that i don't wan't to give father root priviladges. I want to make him admin only for son account.

1 Answers1

2

One simple solution is to simply add yourself to your son's primary group. For example if your username is "father" and your son's primary group is "son" (i.e. by default files are created as belonging to group "son"), then just do this to add yourself to that group:

sudo gpasswd -a father son

You will have to log out and back in for the change to take effect.

[However, your son will still be able to easily hide a folder by setting 700 permissions on it. But if he does that, you can always look into it as root or maybe even add a cronjob which would find such folders and change their permissions. Alternatively, he could encrypt his files and preventing that would be quite difficult, or just save them on a USB stick. In any case, in the long term it's a loosing battle.]

As for umask, as suggested by dadexix86, the default umask of 0022 already makes it so that files and folders are readable by members of the primary group. But it does not prevent your son from using "chmod go-rwx" to change that, unless you prevent him from using "/bin/chmod".

Some possible advanced alternatives:

KIAaze
  • 508