How to set a password for the new user?

QuestionsQuestions4 SkillsProUser Account ManagementNov, 27 2025
0141

To set a password for a new user in Linux, you can use the passwd command. Here’s how to do it:

  1. Run the following command, replacing <username> with the name of the user:
sudo passwd <username>

For example, to set a password for a user named "newuser", you would run:

sudo passwd newuser
  1. You will be prompted to enter a new password twice. Type the password of your choice and press Enter after each entry.

If both passwords match, you will see a confirmation message indicating that the password has been updated successfully.

0 Comments

no data
Be the first to share your comment!