The openssh-server package should be installed when you install your kali, to verify; you can use the following command.
# apt list openssh-server
Once it is installed, it will indicate the following
If it is not installed, you can run this command to install it:
# apt install openssh-server
When you are enabling the service, be sure to fully secure SSH first.
since kali comes with pre-generated SSH keys, to make it more secure, the first thing to do is to generate new ones.
first of all backup the original key as a precaution:
# mkdir /etc/ssh/default_keys
# mv /etc/ssh/ssh_host_* /etc/ssh/default_keys/
Then to regenerate the keys, use:
# dpkg-reconfigure openssh-server
The next step is to edit the SSH server configuration file with the settings you need:
# vi /etc/ssh/sshd_config
and uncomment the following lines:
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