Hi all , newbie here first post and Tx for the forum.

Background : Running vbox 6 on MacBook and originally added kali 2019.2 amd 64 about may 2019,,,, Everything was well, I am using the machine for learning some low level coding so basically only added tmux and ZSH , ohmyzsh in all that time and updated my GCC for assembler and C and python, so nothing much really as we know the simple rule of if it ain?t broken Don?t fix it always works well 😉

So anyway did an apt Upgraded a few days ago and kaboom there goes all my learning time in trying to fix this?

I am writing this more as a story then a serious of commands and hope that?s not too bad.

Grub showed linux 5.6.0-kali2-amd64. However during this upgrades, DPKG seems to have corrupted with gnome , eventually got around that & managed to apt update -f gnome, everything was working fine? then a day or two later trying Tweaks it was not working and had python3 & farraday err msgs in Apt update so apt was basically broken as apperntly it relies on pycompile etc. tried lots of things eventually got python3 & faraday removed and reinstalled with apt remove and apt reinstall, everything was fine , but then did another gnome reinstall just to make sure and all of the sudden my root password will not work anymore.(ps! this process never asked me to set a user at all as I understand the new kali does not use root toor anymore.)

Tried this grub e boot sequence steps here ( https://linuxconfig.org/how-to-reset...-root-password) changing the linux line from ro to rw and adding the init=bin/bash as described f10 ??and various variations of reboot/poweoff etc?.., it basically says password updated successfully at root@(none) prompt, even mount shows it?s writeable everything, but when I go in again it will not recognize that root password. The only diff I see is when entering the grub mode and the root@(none) prompt appears and I want to enter passwd , it displays this, which I dunno how significant it might be :
?[. 66.985294] random: cringe init done ?
Then I basically just have to enter again to get back to the root@(none) prompt.

I tried changing the /etc/ssh/sshd_config entry to ?PermitRootLogin yes?, but still nothing. I also noticed there is no user called kali in etc/password, however following the grub e process referred to above I managed to adduser and added that user to the admin grp as well and can login to GUI with that user? .

In etc/passwd I could now see the user I added in GID 1000. And its only that user, postgresql and root( GID 0 ) which has bash login shells enabled. Sync has /bin/sync
Arpwatch /bin/sh and the rest are no logon or false.

In etc/shadow both root and the user I added have encrypted passwords(long string of gibberish and are the only entries with this. Days between last change of password of root is 18024 and the new user I added is 18433, which means root did not actually change during that recent upgrade as that makes sense it was about 400 days or so ago when I set root on kali 2019.2 last year?.

What was weird is that once logged in with the user I created, I could su to root once in GUI and my old root password still worked for that, I could run apt etc, I still could not do a GUI login with root even after trying passwd root successfully again in gui using the user created and su?.
And then I tried getting all my custom stuff setupnfor the user and somehow using commands like chsh under su with the same root password gave me a pam authentication failure( this was due to somehow my ZSH disappeared from etc/shells and I changed the etc/passwd entry for root back to zsh)
Noticed this when I was in grub e boot at the root@(none) prompt, the ps -p $$ shows PID = 1. TTY = ? , CMD = bash, but the echo ?$SHELL? shows /bin/zsh.

Anyway I edited the etc/password back to bash since that was available in etc/shells. Then could su again to root in GUI and apt installed zsh again and now that it was back in etc/shells I could chsh successfully & su without Pam auth errors. Upto this point I had to do a lot of booting into grub e to use root@(none) and then booting into GUI to get internet until I realized that the the reason I couldn?t su was due to the root user having an invalid shell entry in etc/passwd, that meant no more grub e to get to root( and even when I did I couldn?t do apt or Internet from grub e boot).

Before this post I did a su apt autoclean, dpkg ?configure -a , apt update && apt full-upgrade -y , and got a full update done.On apt list ?upgradeable -a and theres nothing outstanding. Then did the apt auto remove , dpkg config amd apt clean again just to make sure.

In the end I decided I?ll just live in the su world anyway and not go back to using root as my daily user... but for now everything seems fine and zsh, oh my zsh tmux etc all working well, with previous customizing in place. Oh I just copied my .zshrc from my previous root install to my new user ~.

I hope some of the keywords here might help someone else to google some of those keywords and try some actions if they end up in a similar situation.