useradd -u can assign userid and gid at the same time?
Found this example stating you can add a user with a uid and gid at the same time. Both uid and gid are different. I then tried it with the same number for user and group.
Example: Code:
useradd -u 1001 jsmith -g 2001 jsmith Is there a way to add a user by uid and gid with useradd? Or is this incorrect? |
id -g jsmith what is the output?
|
Code:
id jsmith |
try:
groupadd -g 2001 jsmith then the command you posted above: useradd -u 1001 jsmith -g 2001 jsmith |
That worked.
The example that I'm working from can be found here, which I don't think is correct is here: http://www.tecmint.com/add-users-in-linux/ Seems like you have to create the group first and then modify the gid with what you posted. Here is the example: Code:
groupadd -g 2112 glee |
See the man page for useradd:
Code:
-g, --gid GROUP |
All times are GMT -5. The time now is 07:38 PM. |