{"id":24947,"date":"2024-02-26T10:06:36","date_gmt":"2024-02-26T10:06:36","guid":{"rendered":"https:\/\/linuxways.net\/?p=24947"},"modified":"2024-02-26T10:06:36","modified_gmt":"2024-02-26T10:06:36","slug":"enable-ssh-kali-linux-remotely-access-kali-linux-system","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/kali-linux\/enable-ssh-kali-linux-remotely-access-kali-linux-system\/","title":{"rendered":"How to Enable SSH on Kali Linux | Remotely Access Kali Linux System"},"content":{"rendered":"<p><a id=\"post-24947-_h0beklc8uvc4\"><\/a><strong>Secure Shell <\/strong>also called<strong> SSH <\/strong>is a network protocol used to remotely access a system in a secure fashion from any location. <strong>SSH<\/strong> operates on a client-server paradigm where both client and server communicate with each other through a secure channel. SSH uses the encryption and authentication techniques to establish connection with the remote system, allowing you to access the system and use the command-line interface from another computer.<\/p>\n<p>As a Kali Linux user, you will definitely require accessing the system remotely to perform terminal-related tasks. In that case, you will need the services of <strong>SSH<\/strong>, and this guide will provide you with necessary information to enable SSH on Kali Linux.<\/p>\n<p><strong>Outline<\/strong><\/p>\n<ul>\n<li><a href=\"#post-24947-_txzn74yv3lod\"><strong>How to Enable SSH on Kali Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-24947-_2hkverro4mjl\"><strong>How to Use SSH to Remotely Access Kali Linux System<\/strong><\/a><\/li>\n<li><a href=\"#post-24947-_jlkdfhvq7lkh\"><strong>How to SSH into Kali Linux System as a Root User<\/strong><\/a><\/li>\n<li><a href=\"#post-24947-_9tb5byj18izq\"><strong>Conclusion<\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-24947-_txzn74yv3lod\"><\/a>How to Enable SSH on Kali Linux<\/h2>\n<p>Before enabling the <strong>SSH<\/strong> on Kali Linux, you must ensure SSH is installed on your system. <strong>OpenSSH<\/strong> is an <strong>SSH<\/strong> server that manages the <strong>SSH<\/strong>-related queries on the system. To check whether <strong>OpenSSH<\/strong> server is installed on Kali Linux, you can use the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">apt list openssh-server<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"102\" class=\"wp-image-24977\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-1.png 775w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-1-300x39.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-1-768x101.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/p>\n<p>The above output ensures that <strong>OpenSSH<\/strong> server is installed on Kali Linux, if it\u2019s not, you can install <strong>OpenSSH<\/strong> server on the system 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> openssh-server <span class=\"re5\">-y<\/span><\/div><\/div>\n<p>After installing <strong>OpenSSH<\/strong>, you can enable the <strong>SSH<\/strong> daemon on Kali Linux from the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl <span class=\"kw3\">enable<\/span> <span class=\"kw2\">ssh<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"198\" class=\"wp-image-24981\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-2.png 773w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-2-300x77.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-2-768x197.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/strong><\/p>\n<p>Then start the <strong>SSH<\/strong> daemon on Kali Linux through the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl start <span class=\"kw2\">ssh<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"116\" class=\"wp-image-24989\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-3.png 774w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-3-300x45.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-3-768x115.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<p>To check whether <strong>SSH<\/strong> service is actively running on Kali Linux, simply run the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl status <span class=\"kw2\">ssh<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"779\" height=\"416\" class=\"wp-image-24994\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-4.png 779w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-4-300x160.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-4-768x410.png 768w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/strong><\/p>\n<p>The <strong>active (running)<\/strong> status of<strong> SSH <\/strong>daemon ensures that <strong>SSH<\/strong> service is successfully running on your system.<\/p>\n<h2><a id=\"post-24947-_2hkverro4mjl\"><\/a>How to Use SSH to Remotely Access Kali Linux System<\/h2>\n<p>To remotely access Kali Linux system and ensuring <strong>SSH <\/strong>service is successfully operating, you can use the below-given steps:<\/p>\n<h3>Step 1: Find IP Address of Kali Linux<\/h3>\n<p>To remotely access Kali Linux system through <strong>SSH<\/strong>, you will require the IP address of your system, you can do it from the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">hostname<\/span> <span class=\"re5\">-I<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"152\" class=\"wp-image-24999\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-5.png 770w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-5-300x59.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-5-768x152.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/p>\n<h3>Step 2: Open Terminal on a Computer<\/h3>\n<p>Now, to access Kali Linux from another computer, you should open a terminal on your other computer. If you are a Windows user, you can open <strong>Command Prompt <\/strong>or <strong>PowerShell<\/strong>. The Mac and Linux users can simply open the terminal from the desktop or application menu. In all cases, you must have to follow the below-given syntax to remotely access Kali Linux:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ssh<\/span> username<span class=\"sy0\">@<\/span>IP_address<\/div><\/div>\n<p>Here, <strong>ssh<\/strong> command is used to communicate with the SSH server. While, in place of <strong>username<\/strong> and <strong>IP_address<\/strong>, you have to add your Kali Linux username and IP address (Step 1).<\/p>\n<p>In my case, the username is <strong>kali<\/strong>, the IP address of the system is <strong>192.168.221.138, and<\/strong> I am accessing Kali Linux system on <strong>Windows PowerShell<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1097\" height=\"144\" class=\"wp-image-25009\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-6.png 1097w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-6-300x39.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-6-1024x134.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-6-768x101.png 768w\" sizes=\"auto, (max-width: 1097px) 100vw, 1097px\" \/><\/p>\n<p>When you <strong>SSH<\/strong> into Kali Linux for the first time, you will have to authenticate your device and to keep continuing with the current connection, simply enter<strong> yes<\/strong>. Then type the default password for your current user that you are accessing from Kali Linux system:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1093\" height=\"183\" class=\"wp-image-25014\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-7.png 1093w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-7-300x50.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-7-1024x171.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-7-768x129.png 768w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/p>\n<p>After entering the password for the current username, you will be able to access the Kali Linux system with the provided username.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1095\" height=\"408\" class=\"wp-image-25021\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-8.png 1095w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-8-300x112.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-8-1024x382.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-8-768x286.png 768w\" sizes=\"auto, (max-width: 1095px) 100vw, 1095px\" \/><\/p>\n<h2><a id=\"post-24947-_jlkdfhvq7lkh\"><\/a>How to SSH into Kali Linux System as a Root User<\/h2>\n<p>By default, <strong>SSH <\/strong>service doesn\u2019t allow login to the system from <strong>SSH <\/strong>as a root user. It is done to improve the security of the system by preventing unauthorized users from having a complete charge on your system. If, for some reason, you want to access the Kali Linux system as a root user through <strong>SSH<\/strong>, then use the following steps carefully to do that:<\/p>\n<h3>Step 1: Open SSH Configuration File<\/h3>\n<p>First, open the SSH configuration file on Kali Linux terminal with nano editor using the following 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<h3>Step 2: Modify SSH configuration File<\/h3>\n<p>Now, scroll down and find the commented line \u201c<strong>PermitRootLogin prohibit-password<\/strong>\u201d, it can be done by removing the <strong># <\/strong>sign:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"424\" class=\"wp-image-25032\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-9.png 746w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-9-300x171.png 300w\" sizes=\"auto, (max-width: 746px) 100vw, 746px\" \/><\/p>\n<p>After uncommenting the line, simply replace \u201c<strong>yes<\/strong>\u201d with \u201c<strong>prohibit-password\u201d, <\/strong>then save the file by pressing <strong>CTRL+X<\/strong>, add <strong>Y <\/strong>and enter to move back to the terminal.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"751\" height=\"427\" class=\"wp-image-25050\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-10.png 751w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-10-300x171.png 300w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/p>\n<h3>Step 3: Restart SSH on Kali Linux<\/h3>\n<p>After, you have done the required changes in the configuration file, restart the SSH service to reload those changes:<\/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-25056\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-11.png 754w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-11-300x50.png 300w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/p>\n<p>You can then access the Kali Linux system as a root user, using the root in place of username:<\/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=\"1210\" height=\"421\" class=\"wp-image-25060\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-12.png 1210w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-12-300x104.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-12-1024x356.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24947-12-768x267.png 768w\" sizes=\"auto, (max-width: 1210px) 100vw, 1210px\" \/><\/p>\n<h2><a id=\"post-24947-_9tb5byj18izq\"><\/a>Conclusion<\/h2>\n<p><strong>SSH <\/strong>is a useful feature widely used for remotely accessing the system terminal and file sharing between the devices. You can enable <strong>SSH<\/strong> on Kali Linux using the systemctl command followed by the <strong>restart<\/strong> <strong>ssh <\/strong>keyword. You should also start the <strong>SSH <\/strong>service using the systemctl command with the <strong>start ssh<\/strong> keyword. After enabling and starting the<strong> SSH<\/strong> service, you can access the Kali Linux system as a normal user using the IP address of the remote system. To access the Kali Linux system as a root user, you must make some changes in the configuration file, reload the <strong>SSH <\/strong>service and use root instead of username to access the system remotely.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can enable SSH on Kali Linux by first installing the OpenSSH server then enabling the SSH through systemctl command. Read this guide for more details.<\/p>","protected":false},"author":116,"featured_media":25300,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1054],"tags":[],"class_list":["post-24947","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\/24947","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=24947"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24947\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/25300"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=24947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=24947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=24947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}