Install and configure OpenSSH on Kali Linux
SSH is an acronym that means Secure Shell and provides secure access to a remote machine. This allows users to connect to a local and remote computer.
SSH also refers to the suite of utilities that implement the cryptogr1aphic network protocol. We can install SSH on any Unix / Linux machine with the help of OpenSSH.
Without a doubt, SSH always provides strong authentication and encrypts all data between two systems, but there are many methods by which we can easily crack the SSH password that we will discuss in a future article.
The first step is to install the OpenSSH server on a Kali Linux computer by typing the following command.
Mandate: apt-get install openssh-server
Now to check the status of the SSH service, you can check it by giving the command "service ssh statusAt your terminal.
And to start the ssh service on your machine, enter the command "service ssh start".
Now the next step is to set SSH to run continuously and so we need to remove the run levels for SSH by typing the following commands:
Mandate: update-rc.d -f ssh remove
Mandate: update-rc.d -f ssh defaults
The next step is to get the backup of the original SSH keys. You can skip this step, but it is important if you are reconfiguring the OpenSSH package.
To get backups of SSH keys, just create a directory inside / etc / ssh and enter the following command.
Mandate: mv ssh_host_ * backup /
Now to create new keys, just enter the command " dpkg-reconfigure openssh-server ".
By default, the root connection for Kali Linux in ssh is disabled, and to enable it, simply open / Etc / ssh / sshd_config with any editor you like and edit the file according to the screenshot below.
Setting PermitRootLogin to "yes" will enable the root connection for the SSH server. But for security reasons, always try to add a non-privileged user to ssh.
After completing all the above steps, simply restart the SSH service by typing “sudo service ssh restart” and make the ssh service start automatically on each reboot by typing “update-rc.d -f ssh enabled 2 3 4 5".
To make sure that the safe shell starts after restarting, use the systemctl command to enable it:
Mandate: systemctl enabled ssh