Help needed with 'useradd'
From reading the man pages, the -g option in useradd is meant to set
Quote:
Code:
useradd -m bill Code:
useradd -g users -m bill The only way I could create bill with a primary login group of users was to use this command Code:
useradd -G users -g users -m bill Any ideas? Thanks, Steve :) |
I don't see any reason why your command failed.
Code:
#useradd -g users -G other,comma,seperated,groups -m bill The group bill is not created because by stipulating the default group as users, you overode the default behaviour in most Redhat based distros. If you want a group with the same name as the user to be created, you have to do Code:
#useradd -m bill |
Thanks for the quick reply redazz. But...
Why do I *need* to specify -G in addition to -g when I just want to make bill and make his primary group users? Thanks, Steve :) |
Quote:
Code:
#useradd -g somegroup -m user |
Hmm... I should have tested more first... I was looking at /etc/group to check group membership.
You are correct, it does actually work (I tested by su'ing), but how can you list group membership if /etc/group isn't giving you the correct info? Thanks, Steve :) |
To check group membership do
Code:
#groups username |
Thank you very much reddazz.
Steve :) |
Quote:
If the user is member of any other groups (besides the default), his username appears in the corresponding lines of /etc/group. See also: Code:
man id |
Thank you, your "just a hint" hit the nail on the head - perfect!
Steve :) |
All times are GMT -5. The time now is 08:39 PM. |