3

Let's say the group name of user1 is xyz.

Is it possible, in the same Linux machine, that the username of some other user (not user1) is xyz?

3

Yes, it is possible but I wouldn't recommend it as it would be confusing.

Actually it is common practice in most UNIXes and Linux distros, when user xyz is created, to automatically create a group named xyz and assign to it user xyz as its (only) member.

| improve this answer | |
3

It's actually common practice to create group with the same name as user. For example there is root account and root group. Check /etc/group and /etc/passwd files to see it. Check also this two nixCraft pages to get to know more about those files:

Understanding /etc/passwd File Format
Understanding /etc/group File

User account and user group is not combined with each other anwhere else than in /etc/passwd file. So you can have:

user1:x:0:0:user2:/root:/bin/bash
user2:x:0:0:user1:/root:/bin/bash

but I think it can be a little bit confusing.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.