Kali 2020.3 Password incorrect

Hey!

Dipping my toes into Linux and chose Kali for work related purposes.

Installed it via CD/DVD that came with a copy of Linux Format magazine.

During installation got a message that i am missing “regulatory.db iwl-debug-yoyo.bin” if it matters.

So i made my user and chose a password which i wrote down on a piece of paper.
Finished the installation and tried to login, couldnt because it said password incorrect.

Googled it and tried the find linux row and change ro to rw and wrote init=/bin/bash.
Went all the way and chose new password, however that doesnt work either.

Neither does kali username with kali password.

I have no idea what ive done or what i should do, but at the moment ive effectively bricked my laptop cuz i cant login.

Hello.

There are basically 2 “popular” ways to try to fix the issue that you’re experiencing:

1. Use GRUB to boot into single user mode and then change your user’s account password by running this command:

passwd user

…where user is your username. E.g. if your username is kimi625 then boot into single user mode, run passwd kimi625 and then type (and confirm) the new password. Then reboot by either running reboot, init 6, telinit 6 or shutdown -r now.

2. Use your Kali Linux installation media (CD, DVD, USB flashdrive…) to boot into try-it-before-installing mode and then delete your user’s password so you can set a new one.

Once the installation media finishes booting, at the Desktop you’ll likely see the icon of your umounted Linux partition. Double-click it so it’s automatically mounted, then use the file manager to check where it’s mounted (e.g. /media/kali/kalinux/ - yup, I’m making this stuff up. I’ve never installed nor tested Kali in my life, but I’m assuming that these steps are going to work because they’re quite a “default” behavior in many Debian-based distros, and Kali is a Debian-based distro).

Now it’s time to open a shell terminal window/emulator and then become root/superuser by running this command:

sudo su

If you were unable to automount your Kali Linux partition, run the command below in order to check if the /mnt folder exists and create it if it doesn’t:

if [ ! /mnt ] ; then mkdir /mnt ; fi

…and then mount your Kali Linux partition in /mnt with rw (read and write) access (I’m assuming that your Kali Linux partition is sda2, i.e. the 2nd partition of the 1st disk. I’m also assuming that such partition is formatted as an ext4 filesystem):

mount /dev/sda2 /mnt -t ext4 -o rw

Once the partition is mounted, access its root directory. E.g.:

cd /media/kali/kalinux

or

cd /mnt

…and then run this command:

cat ./etc/passwd |more

Press the space key for pagination. The command above will output the records of all user accounts. Assuming that your username is kimi625, you’ll end up finding a line that is going to look pretty much like this:

kimi625:x:1000:1000:Kimi,,,:/home/kimi625:/bin/bash

That x symbolizes your encrypted password. Hence, if you delete that x the system will let you set a new password (it won’t ask you to provide the current password, since there won’t be one). So now you have to edit the passwd file with either a graphical text editor such as Leafpad:

leafpad ./etc/passwd

…or a console text editor such as Nano:

nano ./etc/passwd

Once you’re “inside” the passwd file, scroll down until you reach that line of your user’s account and then delete that x character so the line looks like this:

kimi625::1000:1000:Kimi,,,:/home/kimi625:/bin/bash

The next step is to save the passwd file and exit the text editor, then reboot the system, remove the installation media and, after you boot normally, login by providing only your username (no password shall be asked, because you deleted it) and then open a shell terminal emulator/window again so you can run this command:

passwd

Type (and confirm) a new password for your user account, then reboot the system and check if the procedure worked, i.e. check if the login screen asks for a password and if, by typing this new password, you manage to successfully log into your account.

Hey! Thank you very mych for your reply.
I managed to use the installation media to recover the password, it wasnt actually the password that was the problem although thats what it told me.
I had entered several names during the installation, name for me, name for user account, name for computer etc. The actual login user was kimi625 just as you said, lol.
I was trying to login with kim and other names but didnt try the obvious one.

Now im "in"in so to speak and ready to get started, writing this reply on my laptop, thanks to you.

1 Like

Hi, glad to hear that things worked out for you. Merry Christmas. :santa:t2: