Link to home
Start Free TrialLog in
Avatar of George R. Kasica
George R. KasicaFlag for United States of America

asked on

Cannot login to kali linux systetm under Virtualbox.

System used to work perfectly. GUI comes up type root, ENTER, password ENTER, done
Now I get Sorry that didn't work. Try again.
No amount of tried will get me logged in.

Followed the below instructions to a T. No joy. I really don't want to spin up a new VM and load my utilities again. Any way to fix this>

How to Reset your Forgotten Root Password in Kali Linux 2019.2?

Step 1: Restart your Kali Linux, and when your computer boots up to Grub menu, use your downward arrow key to highlight 'Advanced Options for Kali/GNU linux', and then hit Enter key on the keyboard. 

Step 2: Highlight 'Recovery Mode', and then Press 'e' key on the keyboard.

Step 3: Now, On the Next Screen, Go to line linux and replace 'ro' with 'rw'. Also, go to the end of the line linux and then hit space key, and then type init=/bin/bash. Press 'f10' key (if you are using laptop, press fn + f10 key) on the keyboard. 

Step 4: Type command below to change password

        passwd root

and then hit enter. Type your password, and then hit Enter. Again, Re-type the password, and hit Enter. you will see the message, password updated successfully.

Step 5: Now, use the command below to reboot kali linux.

        reboot -f 

and then, hit Enter. 

Step 6: Let kali linux restart normally, and when you see login screen, enter new password. You will be able to login with that.

It's done 

Open in new window

Avatar of noci
noci

Well that is the correct recovery procedure to change the root password.
Where step 4 actually does change the password, to what you enter there.

If there are problems you can after step 4 and before step 5 check the logging in /var/log/ for login problems (messages, auth, kernel, ...?).
As noci mentions, just go through the password change procedure + all should be well.
Avatar of George R. Kasica

ASKER

I've worked through those steps half a dozen times or more and still get the error posted.

heres dmesg
and syslog
VirtualBox_Kali-Linux-2018.3-vbox-am.png
VirtualBox_Kali-Linux-2018.3-vbox-am.png
VirtualBox_Kali-Linux-2018.3-vbox-am.png
Here are the requested logs - sorry for the screen shots but thats the only way I can grab it with out login working
no auth logging? ...
ls -latr will show the last logs written into... (from the bottom up...)  logs from before the last boot (rescue boot)  and the one after login attempts are useful.
Also logs written to later, just those need to be scrolled up (less {file} until the timestamp of login.... (anything written later can be from boots etc).

dmesg is from last time booting, not that useful for login problems from BEFORE that boot. (and holds the contents of the kernel logbuffer at end of boot).
(all entries in the kernel logbuffer after that are sent to kernel log). The kernel logbuffer at that time also holds data from before syslog service is started.
auth log shot attached
auth.log
Question: is this a system connected to the internet (access from public addresses) with default credentials?...... that is asking for a takeover.
The password was successfully changed on 03:36 & 03:39...  if not by you that  who could do that.
If you didn't do those 2 password changes then you may need to restart a setup as you will never find out if other software for persistence has been installed without your knowledge.


While executing the above procedure no SSH access should be possible during the password change.
As the your shell session is the ONLY active process on the system.  (in effect you replaced the init system by a shell).
Yes those were my activities and changes. Access is from only the desktop console when changing things.

It isn't that bad to reload the whole  thing. Its starting to be a more trouble than its worth to fix issue.
You can check if it is a password issue or a gnome issue by trying to logon using putty in stead of the console.
(it is a wise thing to add a regular (non-root) account and allow that to allow for sudo (preferably with entering the password for that user).
It is a more secure setup, then root logins using SSH can be forbidden enhancing security greatly.
Networking doesn't come up so no SSH ability and yes there are alternate users besides rootTHey fail as well. and yes root via SSH is off only the console can usually use root and this is the problem it fails trying to login
Strange there are login attempts using SSH in the AUTH.log  while there is no network....

Can you login without Gnome (using text mode)?
CTRL/ALT/F1 and then try to login?
(If F1 still is Gnome, try CTRL/ALT/F2 .. until it goes to text mode.)
Mostly the first 6 screens are textmode consoles.
ASKER CERTIFIED SOLUTION
Avatar of George R. Kasica
George R. Kasica
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you both for your efforts