Adding New Users

The command-line approach to adding a user is quite simple and can be accomplished on a single line. In the following example, the system administrator uses the useradd command to add the new user heather. The command adduser (a variant found on some UNIX systems) is a symbolic link to useradd, so both commands work the same. This example uses the -p option to set the password the user requested, the -s to set her special shell (in place of the default bash shell), and the -u option to specify her UID. (If you create a user with the default settings, you do not need to use these options.) All you want to do can be accomplished on one line:

matthew@seymour:~$ sudo useradd heather -p c00kieZ4ME -s ...

Get Ubuntu Unleashed 2015 Edition: Covering 14.10 and 15.04, Tenth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.