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 /bin/zsh -u 1042

The system administrator ...

Get Ubuntu Unleashed 2013 Edition: Covering 12.10 and 13.04, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.