In Linux, the root user account is the account that has access to all Terminal commands and files in the system. The root user can modify their Linux system in any way they choose. In most Linux distributions, including the most recent versions of Kali Linux, the root user account is disabled. This is to prevent users from damaging their system. However, you can unlock the root user account pretty easily in Kali Linux using the Terminal. Warning: Use caution when logged in as a root user. Mistakes can cause permanent damage to your system. You should only log in as a root user if you know what you are doing. [1] X Research source
Kali Root Terminal: How to Access in Linux
- Type sudo apt update into the terminal and press Enter.
- Type sudo apt install kali-root-login and press Enter.
- Type sudo -i and press Enter.
- Enter your user password and press Enter.
- Type passwd root and press Enter.
- Enter a new root password and press Enter, then retype it to confirm.
- Log out of your current user account and into the “root” account.
Steps
-
Login to Kali Linux. Go ahead and use your normal username and password to log in to Kali Linux. Once you set a password for the root account, you can log in using the root account.
-
Press Ctrl + Alt + T to open the Terminal. On most Linux distributions, you can open the Terminal by clicking the Terminal icon in the Apps menu. It has an icon that resembles a black screen with a white cursor. You can also use the keyboard shortcut to open the Terminal, which is Ctrl + Alt + T .Advertisement
-
Type sudo apt update and press ↵ Enter . This command updates the package manager in Kali Linux.
-
Type sudo apt install kali-root-login and press ↵ Enter . This installs the root login package for Kali Linux, if it hasn't already been installed. [2] X Research source
-
Type sudo -i and press ↵ Enter . This command gives your current user account root access in the Terminal. [3] X Research source
- If the administrator has blocked root access, you cannot grant yourself root access in the Terminal.
-
Enter your user password and press ↵ Enter . You must enter your user password to switch to root access. If successful, the text cursor should read "root@computername:~#" in the Terminal, instead of the usual "username@computername:~$."
- When typing a password, a Linux terminal won't display any characters or asterisks. Instead, it will appear blank.
-
Type passwd root and press ↵ Enter . Then prompts you to enter a new password for the root user login.
-
Enter a new root password and press ↵ Enter . This is the password that will be used to log in to the root account.
-
Retype the password and press ↵ Enter . Make sure you enter the password exactly like you did the first time. This confirms the new root password. If successful, you should see a prompt telling you the password was updated successfully.
-
Log out of your current user account. To do so, click the icon that resembles a circle with an arrow pointing right. It's in the upper-right corner. From there you can either click Log Out or Switch User .
-
Log in to the root account. To do so, type "root" in the username field on the login screen. Then type the password you set for the root account and click Log In or press Enter . This logs you in to the root account. [4] X Research source
-
Press Ctrl + Alt + T to open the Terminal. You can verify that you are logged in as a root user by opening the Terminal. It should say "root@computername:~#" by the text cursor by default. You can now access all root commands in the Terminal.
Expert Q&A
-
QuestionHow can I change the root password in Kali Linux?Blain Gunter is a Computer Repair Specialist and small business owner based in Bakersfield, California. He was first introduced to computers at the age of five and has over twenty years of experience in his field. He is both an IT consultant and computer repair technician and takes pride in his ability to troubleshoot anything. He works with hardware, software, Windows, macOS, GNU/Linux, and even vintage electronics.To reset the root password in Kali Linux, you would typically use the command line "passwd root" before rebooting. After executing the command, you'll be prompted to enter and confirm the new password twice, but note that the terminal won't display the password as you type it for security reasons. Given that Kali Linux is designed for security forensics and auditing, the method for resetting the root password may be different or slightly more involved than other operating systems. Always refer to the official documentation or user guides for accurate and secure procedures.
Tips
Warnings
- Use caution when logged in as a root user. There is nothing to stop you from accidentally deleting a critical system file, or executing a critical command that causes permanent damage to your system.Thanks
Expert Interview
Thanks for reading our article! If you’d like to learn more about troubleshooting computers and printers, check out our in-depth interview with Blain Gunter .
References
- ↑ https://mediatemple.zendesk.com/hc/en-us/articles/204643890-an-introduction-to-the-root-user
- ↑ https://linuxconfig.org/how-to-enable-root-login-on-kali-linux
- ↑ https://techdhee.in/how-to-get-root-access-and-root-account-login-into-kali-linux-2020-1/
- ↑ https://www.youtube.com/watch?v=v9Kwo2-vRFs&t=12s