Many company cybersecurity policies mandate that root SSH access be disabled on ESXi hosts and vCenter Server appliances to reduce the attack surface.
This article provides the procedure to disable root shell access (SSH) while maintaining system manageability.
ESXi 7.0.x
ESXi 8.0.x
vCenter Server 7.0.x
vCenter Server 8.0.x
Security hardening policies often require the disabling of direct root login via SSH to minimize the risk of unauthorized access.
Warning: Before performing this operation, ensure that at least one alternative user account exists with equivalent administrative permissions (superuser) to avoid management lockouts.
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bakvi /etc/ssh/sshd_configPermitRootLogin. Change the value to no: PermitRootLogin noEsc, then type :wq! and press Enter./etc/init.d/SSH restartNote: If you need to re-enable root SSH access, revert the PermitRootLogin parameter to yes and restart the SSH service.