VMware vCenter Server
VMware ESXi Server
"VMware does not support configuring Two-Factor Authentication (2FA) or Multi-Factor Authentication (MFA) for the vCenter Server Appliance (VCSA) SSH interface.
The VCSA is a pre-packaged appliance running on Photon OS. Modifying the underlying Pluggable Authentication Modules (PAM) or the SSH daemon configuration (sshd_config) to integrate third-party 2FA solutions is strictly unsupported.
Unauthorized modifications to the appliance operating system can result in upgrade failures, service disruptions, and a loss of supportability.
2FA and MFA are fully supported for the vSphere Client (UI) and vSphere APIs through Identity Provider Federation (e.g., ADFS, Entra ID, Okta) or Smart Card authentication. The SSH interface is designed strictly as a break-glass administrative interface rather than a primary access method.
Supported Methods for Securing VCSA SSH:
Note: Do not attempt to install third-party PAM modules or alter OS-level authentication mechanisms on the appliance.
If you want to utilize Key-Based Authentication for ESXi or vCenter follow the reference articles below.
Allowing SSH access to VMware vSphere ESXi/ESX hosts with public/private key authentication
Enable SSH key-based authentication on vSphere ESXi version 8.0.2 and later
Allowing SSH access to VMware vCenter Severs with public/private key authentication