Install Gnome and enable root login in Kali Linux 2020.2 (Working with Kali Linux 2021.1 also).
Installing Gnome (gdm3) and enabling root login in Kali Linux 2020.2 (Working with Kali Linux 2021.1 also).
Part 1: Installing Gnome (gdm3) on Kali Linux.
Step 1: Checking present configuration.
To know the present user:
whoami
To know the present user id:
echo $UID
To know the present running desktop environment:
echo $DESKTOP_SESSION
Step 2: Open terminal and enter the following command
sudo apt update && sudo apt install kali-desktop-gnome -y
Step 3: “Configuring gdm3” prompt pops up while installing gnome, select “ok” and press enter.
Select “gdm3” as “Default display manager” in next prompt.
Step 4: After completion of the installation reboot the system.
sudo reboot
Now, gnome desktop environment is activated.
Note: To uninstall lightdm use command:
sudo apt remove — purge lightdm
Part 2: Enabling root login.
Step 1: Switch user to root from your present user.
sudo su
Step 2: Create a password for root:
passwd root
Step 3: Exit root.
exit
Step 4: Edit “/etc/pam.d/gdm-password” and comment the following line.
Note: Skip this step if you are enabling root login with lightdm desktop environment.
sudo nano /etc/pam.d/gdm-password
#auth required pam_succeed_if.so user != root quiet_success
Save the file (ctrl + x, y, enter).
Step 5: Now, logout of your present user and login to root by pressing “Not listed?” below the list of users in login screen.
Enter username “root” and your password to login.
Step 6: To enable colors in terminal, copy “.bashrc” file from other user’s (kali) home directory to the home directory of root.
cp /home/kali/.bashrc /root
Note: Change “kali” to your username in the above command.
Close the terminal and reopen it.
Step 7: (Optional) Delete other user.
userdel kali
Conclusion: Gnome has been installed and root login enabled.