{"id":24827,"date":"2024-02-14T05:17:53","date_gmt":"2024-02-14T05:17:53","guid":{"rendered":"https:\/\/linuxways.net\/?p=24827"},"modified":"2024-02-14T05:17:53","modified_gmt":"2024-02-14T05:17:53","slug":"enable-root-login-kali-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/kali-linux\/enable-root-login-kali-linux\/","title":{"rendered":"How to Enable Root Login in Kali Linux"},"content":{"rendered":"<p>Kali Linux, unlike other Linux operating systems, allows users to enter the system as a default user. This case was not there in older versions of the operating systems, but with the new and most recent releases of Linux systems, the root login feature is disabled to protect the system security. While users can use the <strong>su<\/strong> command to login as a root user on terminal and perform terminal related tasks, there are some scenarios where you will require entering the system as a root user. These scenarios include running older security GUI tools or scripts that are specifically for root execution, and more.<\/p>\n<p>In this guide, you will learn:<\/p>\n<ul>\n<li><a href=\"#post-24827-_4ow8lev8kxir\"><strong>How to Enable Root Login in Kali Linux<\/strong><\/a>\n<ul>\n<li><a href=\"#post-24827-_iehwo1izxfea\"><strong>How to Enable Root Login in Kali Linux for SSH<\/strong><\/a><\/li>\n<li><a href=\"#post-24827-_tsrwi5jmnf4p\"><strong>How to Enable Root Login in Kali Linux for GNOME or KDE Login<\/strong><\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#post-24827-_ni08vyaxcqk3\"><strong>Conclusion<\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-24827-_4ow8lev8kxir\"><\/a><strong>How to Enable Root Login in Kali Linux<\/strong><\/h2>\n<p>Before enabling the root login in Kali Linux, you must ensure remembering your root password. If you forgot your root password for Kali Linux, you can run the below-given command to set a new root password:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">passwd<\/span> root<\/div><\/div>\n<p>Enter a new root password, type the new password again to successfully update the root password on your Kali Linux system.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"195\" class=\"wp-image-24845\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-1.png 752w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-1-300x78.png 300w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/p>\n<p><strong>Note: <\/strong>Ensure setting a strong root password for your Kali Linux system to make it hard for someone to crack it.<\/p>\n<p>After setting up the root password, it\u2019s now time to enable the root login in Kali Linux. You can enable root login on Kali Linux for:<\/p>\n<ul>\n<li><a href=\"#post-24827-_iehwo1izxfea\"><strong>SSH<\/strong><\/a><\/li>\n<li><a href=\"#post-24827-_tsrwi5jmnf4p\"><strong>GNOME or KDE Login<\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-24827-_iehwo1izxfea\"><\/a><strong>How to Enable Root Login in Kali Linux for SSH<\/strong><\/h2>\n<p>For enabling the root login in Kali Linux for SSH, follow the steps given below:<\/p>\n<p><strong>Step 1: <\/strong>First, open SSH configuration file on Kali Linux with nano editor through the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">nano<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>ssh<span class=\"sy0\">\/<\/span>sshd_config<\/div><\/div>\n<p><strong>Step 2: <\/strong>Inside the SSH configuration file, scroll down and find the line \u201c<strong>PermitRootLogin prohibit-password<\/strong>\u201d. Remove the <strong># <\/strong>sign from the line to uncomment it:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"424\" class=\"wp-image-24850\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-2.png 746w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-2-300x171.png 300w\" sizes=\"auto, (max-width: 746px) 100vw, 746px\" \/><\/p>\n<p><strong>Step 3: <\/strong>Now, replace the \u201c<strong>prohibit-password\u201d <\/strong>with <strong>yes <\/strong>keyword inside the file:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"751\" height=\"427\" class=\"wp-image-24859\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-3.png 751w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-3-300x171.png 300w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/p>\n<p><strong>Step 4: <\/strong>After performing the changes within the SSH configuration file, save them using <strong>CTRL+X <\/strong>keys simultaneously. Then add <strong>Y <\/strong>for approving the changes, and use the <strong>Enter<\/strong> button to close the configuration file and exit back to the terminal.<\/p>\n<p><strong>Step 5: <\/strong>After applying the changes within the SSH configuration file, you must restart the SSH service on Kali Linux using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl restart <span class=\"kw2\">ssh<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"754\" height=\"126\" class=\"wp-image-24862\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-4.png 754w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-4-300x50.png 300w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/p>\n<p>Once the SSH service is restarted, you can enter the Kali Linux system from SSH as a root user using the following ssh command. Ensure adding <strong>root <\/strong>as a user and IP address of Kali Linux in place of <strong>IP_Address <\/strong>in the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ssh<\/span> root<span class=\"sy0\">@<\/span>IP_Address<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1103\" height=\"337\" class=\"wp-image-24865\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-5.png 1103w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-5-300x92.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-5-1024x313.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-5-768x235.png 768w\" sizes=\"auto, (max-width: 1103px) 100vw, 1103px\" \/><\/p>\n<h2><a id=\"post-24827-_tsrwi5jmnf4p\"><\/a><strong>How to Enable Root Login in Kali Linux for GNOME or KDE Login<\/strong><\/h2>\n<p>If you want to enable root login in Kali Linux for GNOME or KDE Login, follow the below-given steps:<\/p>\n<p><strong>Step 1: <\/strong>It is advised to install the <strong>kali-root-login<\/strong> package on your Kali Linux system that will change multiple configuration files and allow us to enter the system as a root user. This package is optional, and you can skip this step if you don\u2019t require it. In some desktop environments like GNOME GDM3 and KDE, you will need that package, so it is better to install it on Kali Linux from the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> kali-root-login <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><strong>Step 2: <\/strong>Now, log out of your system using the highlighted button shown in the image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"502\" class=\"wp-image-24868\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-6.png 690w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-6-300x218.png 300w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/p>\n<p><strong>Step 3:<\/strong> Then use<strong> Log Out<\/strong> button to log out of the current user:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"844\" height=\"550\" class=\"wp-image-24870\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-7.png 844w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-7-300x195.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-7-768x500.png 768w\" sizes=\"auto, (max-width: 844px) 100vw, 844px\" \/><\/strong><\/p>\n<p><strong>Step 4: <\/strong>At the login screen, enter the username as root and password you previously set in at the start of the process. After entering the root credentials, simply use the<strong> LogIn <\/strong>button:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1016\" height=\"651\" class=\"wp-image-24874\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-8.png 1016w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-8-300x192.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-8-768x492.png 768w\" sizes=\"auto, (max-width: 1016px) 100vw, 1016px\" \/><\/p>\n<p>After you have completed the above step, you will be able to enter into the Kali Linux system as a root user, and you can confirm it by opening the terminal. There, you will be able to see your username as<strong> root<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1276\" height=\"757\" class=\"wp-image-24877\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-9.png 1276w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-9-300x178.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-9-1024x607.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24827-9-768x456.png 768w\" sizes=\"auto, (max-width: 1276px) 100vw, 1276px\" \/><\/p>\n<p><strong>Note:<\/strong> To login back to a specific user, log out the system and follow the same procedure for login to the system by replacing<strong> root <\/strong>with username and add password for the entered username.<\/p>\n<h2><a id=\"post-24827-_ni08vyaxcqk3\"><\/a><strong>Conclusion<\/strong><\/h2>\n<p>Enabling root login in Kali Linux offers advantages as well as disadvantages. However, if you are sure about your system security, you can enable root login on your Kali Linux system by first setting a strong root password. Doing this will protect your system and prevent the hacker from accessing it as a root user. After setting the root password, you can enable root login in Kali Linux for SSH or GUI login using the methods presented in the above-sections of this blog. Both methods require login credentials like username as <strong>root <\/strong>followed by the root password later on.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can enable root login in Kali Linux for SSH and GNOME or KDE login. Read this guide to learn how to enable root login for these methods. <\/p>","protected":false},"author":116,"featured_media":24918,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1054],"tags":[],"class_list":["post-24827","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kali-linux"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=24827"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24827\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/24918"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=24827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=24827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=24827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}