In this article, we are going to learn how to enable and disable root login on Kali Linux. We all know now Kali Linux disables the root login by default. We have to log in as a standard user account which is created while we install the Kali Linux on our PC/Laptop. We can not log in as root. So we have to enable it or you can disable it if you want. So let’s start.
Update Kali Linux
So first of all we have to update the Kali Linux using this command:
$ sudo apt update
Enable root Login on Kali Linux
So we have to enable root Login on Kali Linux. So we need a sudo privilege user’s account. So you have permission or privilege to run all the commands with sudo. So install kali-root-login package using this command:
$ sudo apt install kali-root-login -y
Login as root in terminal
We have to log in as root in the terminal. You can log in with the following command:
$ sudo -i
Set the root Password
Now using the following command you can set the new password for your root account.
# passwd root
Now we have enable root Login on Kali Linux, We have to logout from the current account and login with root.
Login as root
Now here enter the root as username and enter the new password to login as root.
So this is the way how to Enable root Login on Kali Linux. Now you can verify the login user using whoami or pwd command.
Disable Root Login on Kali Linux
To disable the root account first of all logout from root account. And login as normal user. Now we have to remove the kali-root-login package using this command:
$ sudo apt --purge remove kali-root-login -y
Remove the root Password
If you are still login as root. You have to using the following command you can remove the password for your root account.
$ sudo passwd -l root
So this is the way how to disable root Login on Kali Linux. .
IMPORTANT THINGS TO REMEMBER
- This article was written only for educational purposes.
- The author can not be held any responsibility for damage caused by the use of these resources.
- You will not use this information to gain unauthorized access or any other legal activity.
Read also Disclaimer
If you are using any illegal activities using these techniques kalilinuxtutorial.com can’t hold any responsibility for your action.
This blog only for educational purposes where you will learn about Kali Linux how it works and how you can install any tools in Kali Linux.
If you have any questions about this article, any feedback, suggestions, or if you want to share your thoughts, please feel free to comment below.
If you want to speak with us directly you can Contact Us.