Archive

How do I create a new user from a terminal / command line in Unix / Linux

In Linux the command to use is '/usr/sbin/useradd'.  If you are not root, it likely isn't in your search PATH and you probably will run into permissions problems.

 Here is the syntax:

useradd -m -d /home/joeuser -c 'user description' -s /bin/bash -g joeusergrp joeuser

-d creates the users home directory

-c adds user comment

-s is for the users default shell

-g is for the security group to add the user to

joeuser is the id that you pick

joeusergrp is the usergrp that you should have already created before you started.