0

When I got Linux put onto my personal laptop, I wasn't asked to create a password. Now, whenever my screen goes black, I've got to power it down and restart it in order to get back to the screen I was originally on. How can I create a password so I don't have to do that any longer?

1 Answers1

0

Open a terminal window and enter the following command:

whoami

This will return your user name.

Assuming you have root privileges, enter the following command on the terminal:

sudo passwd your_user_name

where your_user_name is your real user name returned by the whoami command. Enter a new password (two times for verification).

Use that password whenever the system prompts you.

Note: The above may not work if sudo prompts for your current password which you do not know.

FedKad
  • 10,515
  • passwd should NOT be run with sudo - passwd uses setuid to gain file access. sudo passwd changes root's password. – waltinator Jul 22 '19 at 17:20
  • Actually this was a shortcut for sudo -i and then passwd your_user_name. If the first command (sudo -i) prompts for current user's password then this method will not work, since the current password is not known. – FedKad Jul 22 '19 at 17:34