First make sure that kali in the virtual machine is connected to the network of the real host, and then open ssh in kali. You need to modify the command to open ssh.
Secondly, knock the command vim &;; /etc/ssh/sshd_config, delete the comment # before # PasswordAuthenticationyes.
Delete the comment # before # permitrootloginprohibit-password and change the forbidden password to yes.
Then save it back to root mode.
Servicesshstart starts the ssh service.
Update -rc .Dsshenable boot self-starting ssh service.
Update -rc .Dsshdisable closes the boot and starts the ssh service.