install and enable ssh server, sshd or openssh-server


on ubuntu 

sudo apt install openssh-server
kali

pacman -S openssh
systemctl start sshd.service
systemctl enable sshd.service
ssh localhost




Optional: Could also modify the config file


root@dc1-lan1-server:~# more /etc/ssh/sshd_config | grep PermitRootLogin

PermitRootLogin yes  <<<<<<< Add this one


vi /etc/ssh/sshd_config

systemctl restart sshd.service