RHCE # Week # 280

Question: 

Which of the following commands can be used to add a new user in Linux?

A. mkuser
B. addnewusr
C. useradd
D. newuser


Explanation:


The useradd command is used on Linux and other Unix-like operating systems both to add new users, inclusive of their user names, passwords and other data, and to update default new user information.

Depending on command line options, the useradd command will update system files (/etc/passwd and /etc/shadow file with password) and also create the new user's home direcotry and copy initial files.

Create a new user named knight
useradd knight

Set password for knight
passwd knight

Without password user account will be in locked status. To unlock the account, you need to use above passwd command. Use passwd command to assign a password and set password aging guidelines.

Answer:  C