Login
Remember
Register
Ask a Question
How do you create a new user account and set the password for a user from a shell prompt in Linux?
+1
vote
asked
Feb 18, 2021
in
Linux
by
SakshiSharma
How do you create a new user account and set the password for a user from a shell prompt in Linux?
#linux-account
account-password
linux
linux-shell
shell-prompt
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Feb 18, 2021
by
SakshiSharma
To create a new user account from a shell prompt follow the below steps:
Log in as root user if you are not logged in as root using su – command.
Enter the root user password
The useradd command is used to create a new user in Linux. So, type command useradd and give the username you want to create as given below:
Useradd smith
To set the password of the user smith type the command: passwd smith
It will prompt for the new password. Enter the new password for user smith.
It will ask to retype the password. So, retype the same password and password is set for the user.
...