Is it possible to create a user with specific default home directory and add the user to specific primary group with single command?
Ubuntu – User creation with mutiple command options
command lineuser-management
command lineuser-management
Is it possible to create a user with specific default home directory and add the user to specific primary group with single command?
Best Answer
You can do this with
useradd
. I added the line to prove that it is possible. In general runningpasswd
afterwards when doing it manually is more secure and the best way to go.From
man useradd
:So you should better do it in two steps, this way the password does not get logged by the system.
And you can get even this into a one line action: