O'Reilly logo

Practical Linux by Bill Ball, John Ray, Michael Turner, M. Drew Streib

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding, Editing, and Deleting Users Using the Command Line

Unfortunately, it isn't always possible to use a graphical tool such as usercfg to manipulate users. In these instances, you can manipulate users with the command-line versions of using the tools called useradd, usermod, and userdel for adding, modifying, and deleting users, respectively.

Adding Users with useradd

To add a user with the useradd command,log in to the root account and enter the following command:

[root@insocoxygen /root]# useradd -d homedir -s /bin/tcsh [ic]
                  -c "User's Real Name" newlogin

homedir is the home directory of the user being created, set by the -d option. User's Real Name is the real name of the user, added using the comment, -c, flag. (Be sure to have the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required