You can add a password to a user in Linux using the passwd command.
Here's how:
- Open a terminal: You can do this by pressing Ctrl + Alt + T or searching for "Terminal" in your applications menu.
- Run the passwd command: Type the following command and press Enter:
sudo passwd username
Replace "username" with the actual username of the user you want to add a password to.
- Enter the new password: You will be prompted to enter the new password twice for confirmation.
- Confirm the password: Enter the new password again when prompted.
Example:
To add a password to the user "john", you would run the following command:
sudo passwd john
Note: You need to have root privileges to use the passwd
command. If you are not logged in as root, you will need to use the sudo
command to gain root privileges.