VMware vSphere 7.x
VMware vSphere 8.x
This issue occurs due to incorrect sshd configuration of the ESXi host where the PermitRootLogin value is set to NO.
1. Login to ESXi host using Direct Console User Interface (DCUI) with root credentials
2. Navigate to the sshd_config file under cd /etc/ssh
3. Take a backup of the sshd_config file,
cp sshd_config sshd_config.bak
4. Using a text editor, open the file vi /etc/ssh/sshd_config
5. Locate the line PermitRootLogin no and change it to PermitRootLogin yes
6. Save the configuration file
7. Post that will be able to login to SSH session of the host