Unable to take a SSH session on an ESXi host while using root credentials.
Cause
Manual user changes are made to the sshd_config file of the ESXi host which some customers would not be aware of. If the changes are made manually to ensure users are restricted to setup a SSH session would need to be relayed to the customer else will need to find the differences made to the sshd_config file made for the host in question with that of a working host's sshd_config file to resolve the issue.
Resolution
Non-working host:
Working host:
Take a backup of the sshd-config file located in /etc/ssh location for the host in question
Compare the sshd_config file residing in /etc/ssh/ location of a working host with the not working host.
In working host, the following parameter PermitUserEnvironment was set to no and in non-working host observed the parameter PermitUserEnvironment was set to yes.
Change PermitUserEnvironment to no in the non-working host.
And in the last line of the sshd_config file in the non-working host observed the following line AllowUsers sshuser while in the working host the aforementioned line wasn't present.
Remove the last line that is AllowUsers sshuser in the non-working host.
Additional Information
The changes made to the sshd_config file of the host needn't be the same. Compare the changes made on the sshd_config of the non-working host with the working host's sshd_config file.