OpenSSH Server full installation guide
The Offensive Security distribution Kali used by many security testers recently released version 2017.2 of their current release. For quite some time now (Since version 2.0) Kali has used Systemd (System Management Daemon) in place of an init system. This change bring new revolution of enabling and starting services, even though many people are still using the old commands, which often still work but may also lead to errors. I will guide you Systemd method for enabling and starting the SSH (Secure Shell) service on Kali Linux Terminal;.
The openssh-server package should already be installed in kali, to verify this you can use the bellow command:
The openssh-server package should already be installed in kali, to verify this you can use the bellow command:
If it installed you see like...# apt list openssh-server
If it’s not installed, you can use
this command to install it:
# apt install openssh-server
Before you start SSH, please secure first. Since
Kali comes with pre-generated SSH keys, to make it more secure, the first thing
we will do is generate new ones.
To back up the original keys first
as a precaution use:
# mkdir /etc/ssh/default_keys# mv /etc/ssh/ssh_host_* /etc/ssh/default_keys/
Then to regenerate the keys:
# dpkg-reconfigure openssh-server
The next step is to edit the SSH
server configuration file with the settings you need:
# nano /etc/ssh/sshd_config
If you are only planning on using
SSH briefly the defaults are probably fine. If you think you will use it
for a length of time I would recommend at minimum enabling public key
authentication:
PubkeyAuthentication yes
Then disabling password
authentication:
PasswordAuthentication no
If you only need to temporarily
start up the SSH service it’s recommended to use ssh.socket:
# systemctl start ssh.socket
When finished:
# systemctl stop ssh.socket
To instead permanently enable the
SSH service to start whenever the system is booted use:
# systemctl enable ssh.service
Then to use SSH immediately without
having to reboot use:
# systemctl start ssh.service
To check the status of the service
you can use:
# systemctl status ssh.service
To stop the SSH service use:
# systemctl stop ssh.service
And to disable the SSH service so it
no longer starts at boot:
# systemctl disable ssh.service
This is a guide to for SSH on kali. Please feel free comment or feedback about this post.




















































