I am a newbie on linux. I followed an example from manpage I ran from linux platform in regards to how to create user/group and add a user to a group but when I ran id command output didn't reflect what I expected.
This is what I did.
- sudo su -
- groupadd profilers (created new group name profilers)
- adduser user1 (created new user name user1)
- passwd user1 (set password for user1 account)
- useradd -G profilers user1 (add user1 to group name profilers)
- id user1
- uid=526(user1) gid=527(user1) groups=527(user1)
I thought gid and groups would be profilers but not. I am not sure what is happening. Also I tried this command (useradd -g profilers user1) but output was same...
I tried with "usermod -a -G groupName userName" command for user1 account and this is output.
uid=526(user1) gid=527(user1) groups=527(user1),526(profilers)
Another question came to me, why gid is set to user1? I thought gid=group id so it should point to profilers (groupName).