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 ...

Get Practical Linux 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.