Can't remember my password to authenticate

berkoboy

New Member
Joined
Apr 27, 2019
Messages
1
Reaction score
0
Credits
0
I am trying to install updates on my laptop, ubuntu 16.04 LTS but after downloading it asks for authentication, I type in what I think is what I gather is a password that I must of put in when I first installed the os. Where can I find out what it is, or is it not a password which I set up in the first place.TX
 


The short answer is... No it isn't stored anywhere you can see it.

A work around that "usually" works. The caveat is that you have another linux box with a password that you "do" know.
There is a file called /etc/shadow. It will likely have quite a lines in it.

There will be a line similar to this.

dos2unix:$6$sD28D64H8mSNvwaB$gZ3RABsFy7YtdvxNEH8bU6sqX6A0Kcth1tkY.0leTP9NJFZGlTY0ZHLHCOLVjXNDV8vG/uPlVNjz8Oajd7I/Wo1::0:99999:17:::

The beginning of the line is obviously your username, or user ID. The numbers at the end of the line are your user "number" and group ID number. However you don't care too much about those parts.
It is the characters between the ":"'s right after your username that you want. Yes, it's a LOT of characters. copy and paste is preferred. You can type them in manually, but if you make one single typo, this won't work.

This is your encrypted password. Hackers feel free to un-encrypt mine here, This isn't my actual hash string, just random characters I typed in.

The idea is to boot from Linux USB drive, mount your /etc filesystem to the /mnt directory on your USB drive. (This doesn't really work from DVD/CD-ROM).
Then edit your /mnt/etc/shadow file. Replace the string between the :'s, in the case of the example above it would be the $6$sD28D64H8mSNvwaB$gZ3RABsFy7YtdvxNEH8bU6sqX6A0Kcth1tkY.0leTP9NJFZGlTY0ZHLHCOLVjXNDV8vG/uPlVNjz8Oajd7I/Wo1
You will need root or sudo privileges to do this. Also you will need the encrypted has string of a "known" password to paste in and replace the "unknown" password string.

Once you have done this, save the shadow file with the "new" password. Take the USB drive out and reboot. You should be able to login now.

Some LInux's have you create a root account and set a root password during the installation, as well as creating your own account and password. If you know the root password, you can login as root and reset your password.

#> passwd dos2unix (or whatever your username is). You will have to type in the password twice. Make sure you have it memorized, or (ahemm..) written down someplace safe. I personally recommend the memory method
and the "written down" method is insecure.
 
""I am trying to install updates on my laptop"".....How have you installed updates prior to this ?
 
One other thing to consider. Have you logged in since you may have forgotten the password? If you reboot and log in, and know that password, then as someone with SUDO rights, you know your password and it's the same for updates. That is, unless you don't have sudo rights and require a second (admin) account for this. If you haven't rebooted and haven't had to log in in a long time, then you may need to do as Dos2unix suggests above.
If you're not sure if you have sudo rights, and the account password for that matter, open terminal and type "sudo apt-get update". It will ask for your password. If you have rights, then it will download the updated info to your computer and then you can type "sudo apt-get upgrade" to install the updates. Type those commands without the quotes. Let us know how it goes.
 

Members online


Top