If you are looking for a secure way to access Kali Linux remotely then using SSH (Secure Shell) is the way to go. Using an SSH client such as Putty allows you to remote login to Kali Linux securely over an unsecured network. Learn how to setup SSH server on Kali Linux by following a few simple steps.
Before you start you will need to have Kali Linux installed on a computer or device. You will need a second computer or device that will be used to access Kali Linux remotely via SSH. If you don’t have a second computer you can learn how to build a hacking lab with VirtualBox which allows you to run nearly any operating system on a single computer.
HOW TO SETUP SSH SERVER ON KALI LINUX – INSTALLING PUTTY
On the computer or device that you are using to access Kali Linux remotely via SSH you will need to download and install Putty. The website only offers an executable file (exe) so you will need to save it to your desktop or another location of your choice. When you want to run Putty you just locate that executable file that you saved and run it.
USING AN SSH CLIENT ALLOWS YOU TO REMOTE LOGIN TO KALI
You should already have Kali Linux updated and/or upgraded to ensure everything is up to date. Updating Kali Linux can be performed using the following commands:
Next you will need to enable SSH in Kali as well as make a few changes to the configuration file to provide added security. This will be the last step for learning how to setup SSH server on Kali Linux.
HOW TO SETUP SSH SERVER ON KALI LINUX – CONFIGURING SSH
First you need to check if SSH is already enabled. You can check the status of all running services by entering the following command into a terminal:
If you do not see ssh in the list of services then you will need to install it by typing the following:
apt-get install openssh-server
Now you will need to start ssh by typing:
service ssh start
Now you can check the status of ssh by using the command:
service ssh status
You should notice that ssh is active and running. Now you need to make some changes to the configuration file by navigating to the ssh directory:
EDITING SSHD_CONFIG FILE
Use nano to edit the sshd_config file by typing the command:
To harden the security it is wise to change the port number. By default the port number for SSH is 22. You can change this port to any number of your choice as long as you don’t choose a port that is already in use by another service. Port numbers range from 0 to 65535.
Now you need to restart SSH by issuing the command:
service ssh restart
CREATING AN RSA KEY PAIR
To provide a little more added security you can create an RSA key pair. You can generate a key pair by using the command:
ssh-keygen -t rsa
After you issue this command it will ask where to save they key. You can leave it as the default location and press “Enter“. It will then ask you to enter a passphrase and you can leave this as default as well and press “Enter“.
HOW TO SETUP SSH SERVER ON KALI LINUX – USING PUTTY
To finish up learning how to setup SSH server on Kali Linux you need to open up Putty that you should have already downloaded. Enter your IP adress and the port number that you chose to use in your sshd_config file. If you don’t know you IP address you can use the “ifconfig” command in your terminal.
When you have your IP address and the port number entered correctly click the “Open” button.
When you click the “Open” button you will see a window about the server’s fingerprint. Click the “Yes” button to continue.
Now you should see a black window pop up that looks similar to a terminal session. Login as “root” and enter your password. You have successfully created a remote connection via SSH.