I was really torn on what title to give this post. I'm fine-tuning permissions on shares and have found an odd "anomaly" associated with the groups that are automatically created when you create a user. For instance, if you create 'user1' a group called 'user1' is also created. All well and good. But I'm trying to implement a sort of private directory for users and I've either arrived at the wrong paradigm or I'm not understanding how groups and permissions in Ubuntu work. And, yes, it could be both.
Let's say I created my own administration user called 'myadmin'. Then I create a user of the server called 'user1'. In order to give them their own space on the server I create a directory called 'user1data'. In order to give them full rights to their directory I can execute 'sudo chgrp user1 user1data'. With a chmod statement using '770' I'll give the directory owner and the user's group all rights while not allowing anyone else access.
In my mind, I should be able to add the 'myadmin' user to the user's group named 'user1' and have all access. But this doesn't work. The user 'myadmin' gets no access while the user, 'user1' gets all access. If I create a new group, such as 'user1datagroup' and make 'user1' as well as 'myadmin' users, then 'sudo chgrp user1datagroup user1data'. All will work fine.
Clearly, the group created for each user when the user itself is created doesn't behave like a normal group when it comes to permissions.
Why is that?
I'll assume I can't fix that and will think about another way to manage shares and private directories. But, for now, I'd at least like to have my observation affirmed with an explanation of the odd-seeming-to-me (noob) behavior.
Thanks!
Bookmarks