Loading...

We've detected that your browser language is Chinese. Would you like to visit our Chinese website? [ Dismiss ]
By: Dylan

When administrators try to connect to a VMware vCenter Server Appliance (VCSA) through SSH, they may encounter an error such as:

“Received disconnect from x.x.x.x: 2: Too many authentication failures”

Or

“Server sent disconnect message type 2 (protocol error): Too many authentication failures”

Too Many Authentication Failures

Don’t worry, this guide will explain why the error happens, how to troubleshoot it step by step, and the best practices VMware administrators can follow to prevent similar SSH authentication problems in production environments.

Why vCenter Say “Too Many Authentication Failure”?

When you initiate an SSH connection, your SSH client automatically offers every public key it finds in ~/.ssh/ (and any keys loaded into your SSH agent) to the server, one by one. The vCenter Server Appliance (VCSA) runs on VMware’s Photon OS, which has a very low MaxAuthTries limit — often set to 2. That means after the server rejects just two offered keys, it terminates the connection before ever asking for your password.

The root cause is almost always client-side: your SSH client is offering too many invalid keys too quickly, exhausting the server’s limit before password authentication even gets a turn.

That said, there are also server-side causes: AllowGroups restrictions in sshd_config, a locked root account from pam_tally2 or faillock, or an expired root password. By default, the vCenter Appliance root password expires every 90 days.

The table below shows the symptom, likely cause, and fix; you can refer to it in the next section.

Symptom

Likely Cause

Recommended Fix

Connection dropped immediately, no password prompt

Client offering too many SSH keys

Fix 1 or Fix 2

Password prompt appears, but authentication fails

Root password expired, AllowGroups restriction, or wrong credentials

Fix 3 or Fix 5

Message: “Account locked” or similar

PAM tally or faillock lockout

Fix 6

You can log in with SSO account but not root

Root password expired or locked

Fix 5

You’re completely locked out of SSH

Multiple issues combined

Fix 7 (VAMI)

How to fix vCenter Too Many Authentication Failures

Run ssh -v root@vcenter-ip to see exactly what’s happening during the connection attempt. The verbose output will show you which keys are being offered and where the failure occurs.

Protect VMware vCenter Environment

Before getting down to any fixes, please back up your VMware VMs in case of any misoperation. Info2soft i2Backup is a robust backup solution that allows backup of all VMs from an intuitive interface. Support backup scheduling, agentless backup, immutable backup, and more. Click the button to get a 60-day free trial.

FREE Trial

Before get down to any fixes, please back up your VMware VMs in case of any misoperation. Info2soft i2Backup is a robust VMware backup solution that allows backup all virutal machines from an intuitive interface. Support backup scheduling, agentless backup, immutable backup, and more.

Fix 1. Client-Side: Disable Public Key Authentication

This is the fastest fix to solve it. It tells your SSH client not to present any public keys, forcing it to proceed directly to password authentication.

One-liner command:

bash
ssh -o PubkeyAuthentication=no root@vcenter-ip

Replace vcenter-ip with your vCenter’s FQDN or IP address. You’ll be prompted for the root password immediately.

Permanent client configuration:

Add this to your ~/.ssh/config file:

text
Host vcenter-ip
PubkeyAuthentication no

Now every SSH connection to that host will skip key authentication.

When this fix works: When the connection drops before the password prompt and you know the root password is correct.

Limitation: This only works if the root account is not locked and the password is valid. If you’re locked out due to failed password attempts, this won’t help.

Fix 2. Client site: Limit SSH Keys Offered (IdentitiesOnly)

If you want to keep using SSH keys for other hosts but stop your client from flooding vCener with irrelevant keys, use the IdentitiesOnly option.

This tells SSH to only use the key you explicitly specify, ignoring all others in ~/.ssh/ and your SSH agent.

Permanent configuration in ~/.ssh/config:

text
Host vcenter-ip
   IdentitiesOnly yes   IdentityFile ~/.ssh/your-vcenter-key

One-liner:

bash
ssh -o IdentitiesOnly=yes -i ~/.ssh/your-vcenter-key root@vcenter-ip

Alternative: Clean up your ~/.ssh/ directory. Remove old or unused keys — especially if you have both RSA and Ed25519 keys, as SSH will offer both. Each rejected key counts toward MaxAuthTries.

Fix 3. Server-Side: Check and Modify Allow Groups in sshd_config

If the above fixes not working, the problem may be on the vCenter server itself.

AllowGroups wheel in /etc/ssh/sshd_config restricts SSH access only to members of the wheel group. If root isn’t in that group (or the line is present and uncommented), root login via SSH will fail.

How to check:

bash
cat /etc/ssh/sshd_config | grep AllowGroups

If you see AllowGroups wheel, that’s the root cause.

Note: In case of any misoperation, please back up your VMware config file and VMs.

How to Fix:

Way 1. Comment out the restriction (widens access):

bash
vi /etc/ssh/sshd_config
# Change this line:
# AllowGroups wheel

Way 2. Add root to AllowGroups

bash
AllowGroups wheel root

Restart SSH:

bash
systemctl restart sshd

Fix 4. Server-side: Increase MaxAuthTries

You can increase the MaxAuthTries limit to give your client more attempts before the connection is terminated. Photon OS defaults to 2, while STIG compliance requires 6.

Note: Increasing MaxAuthTries can weaken brute-force protection, and an attacker gets more guesses, so this is not recommended compared with other fixes in this article.

How to check current value:

bash
sshd -T | grep -i maxauthtries

How to change it:

Edit /etc/ssh/sshd_config:

bash
MaxAuthTries 6

Restart SSH:

bash
systemctl restart sshd

Fix 5. Recover Root Access via SSO Account

If you’ve lost or forgotten the root password, or it has expired, but you still have a working SSO administrator account, you can recover root access without a reboot.

Step 1. SSH in with your SSO account.

bash
ssh administrator@administrator account

Step 2. Enable the shell:

bash
shell.set --enable true
shell

Step 3. Reset root password:

bash
sudo passwd root

Step 4. Verify:

bash
sudo -i

Enter the new root password to confirm.

Fix 6. Unlock Root Account Using pam_tally2 or faillock

If you’ve attempted SSH login with the wrong password multiple times, the root account may be locked by PAM (Pluggable Authentication Modules).

Critical version difference:

vCenter Version

Command

8.0 U1 and earlier

pam_tally2 –user root –reset

8.0 U2 and later

/usr/sbin/faillock –user root –reset

Starting from 8.0 U2, the unlock policy in vCenter Server changed from pam_tally2 to faillock

Check failed login count:

bash
# 8.0 U1 and earlier
pam_tally2 --user root

# 8.0 U2 and later
/usr/sbin/faillock --user root

Unlock the account:

bash
# 8.0 U1 and earlier
pam_tally2 --user root --reset

# 8.0 U2 and later
/usr/sbin/faillock --user root –reset

⚠️ Important lockout behavior in vCenter 8.0 U2+:

  • The default faillock unlock time is 86400 seconds (24 hours) for most accounts
  • However, if the default shell for root is /bin/appliancesh (which is the default), entering a bad password locks the account for 5 minutes
  • To check root’s default shell: grep root /etc/passwd

Workaround for appliance shell lockout: Switch root’s default shell to /bin/bash

bash
chsh -s /bin/bash root

This also enables key-based passwordless authentication.

 You need existing SSH or console access to run these commands. If you’re completely locked out of SSH, use Fix 7 (VAMI) first to regain access, then run the unlock command.

Fix 7. Alternative Access: VAMA (Port 5480) as Backup Path

If none of the client-side tricks worked, your account’s locked, or you fat-fingered sshd_config and broke SSH entirely. It happens. Don’t panic—you’ve still got a way in.

Fire up a browser and hit the VAMI web interface on port 5480. It’s the appliance’s management console, and it doesn’t care whether your SSH daemon is having a meltdown.

What is VAMI? The vCenter Appliance Management Interface runs on port 5480 and provides a web-based management console for the appliance.

Access VAMA:

text
https://vcenter-ip:5480

Login credentials: Use your SSO Admin credentials (administrator@vsphere.local), not the root password.

What you can do from VAMI:

  • Change the root password from the top-right menu (provided the root account is not locked)
  • Enable or disable the SSH service
  • Check service status and troubleshoot further

If the root user is locked and you need to unlock it via VAMI:

Step 1. Log in to VAMI with SSO Admin credentials.

Step 2. Enable the bash shell: shell.set –enable true

Step 3. Enter the bash shell: shell

Step 4. Unlock the root user:

  • 8.0 U1 and earlier: sudo pam_tally2 –user root –reset
  • 8.0 U2 and later: sudo /usr/sbin/faillock –user root –reset
Note: The root password expires after 90 days by default in vCenter 6.5 and later. If you can’t log in to VAMI either, you may need to reset the root password via the VM console or GRUB boot options.

Prevent vCenter Too Many Authentication failure in Future

1. SSH key management:

  • Only keep active, valid keys in ~/.ssh/
  • Remove old RSA keys if you’ve migrated to Ed25519
  • Use IdentitiesOnly per-host in your SSH config

2. Client configuration:

    • Add host-specific entries in ~/.ssh/config for vCenter
    • Use IdentitiesOnly yes and explicitly specify the IdentityFile

    3. Server hardening (documented):

    • If you modify sshd_config, document the change
    • Consider adding root to AllowGroups rather than removing it entirely
    • Keep MaxAuthTries at default (2) for security — don’t weaken it

    4. Root shell configuration:

    • If you need key-based authentication, set root’s shell to /bin/bash
    • Be aware that changing the shell changes lockout behavior in vCenter 8.0 U2+

    5. Password expiration management:

    • Root password expires every 90 days by default
    • Consider extending or disabling expiration for automation accounts using chage -M 99999 root
    • Or adjust expiration settings via VAMI

    6. Monitoring:

    • Set up alerts for Too many authentication failures in vCenter logs
    • Monitor failed login attempts to detect brute-force attacks early

    7. Automation:

    • Include SSH configuration in infrastructure-as-code (Ansible, Terraform)
    • Document SSH access procedures in your runbooks
    • Test SSH access periodically, especially after vCenter upgrades

    Protect VMware Environment Against Unexpected Failures

    Administrators occasionally lose direct access to critical infrastructure due to authentication issues, configuration mistakes, or unexpected system failures.

    Even if SSH access is temporarily unavailable, your ability to quickly recover VMware workloads should never depend on a single management interface. That’s why many organizations combine proactive troubleshooting with a comprehensive backup and recovery strategy.

    For enterprises running VMware vSphere environments, i2Backup provides agentless backup and recovery for virtual machines, helping IT teams protect business-critical workloads against hardware failures, accidental deletion, ransomware attacks, and other unexpected incidents. Built on VMware’s native backup APIs, i2Backup supports consistent VM backups without installing agents inside guest operating systems, reducing administrative overhead while minimizing performance impact.

    Key capabilities include:

    • Agentless VMware backup using native VMware APIs
    • Granular recovery of individual files or entire virtual machines
    • Scheduled full and incremental backups to reduce backup windows
    • Support for VMware vSphere, ESXi, and vCenter Server across multiple versions
    • Centralized management for protecting large-scale virtual environments

    Just hit the button below to request a 60-day free trial and we will contact you as soon as possible.

    FREE Trial for 60-Day

    Conclusion

    The “Too many authentication failures” error in vCenter is usually caused by the SSH client attempting too many authentication methods before reaching the correct credentials—not by an incorrect password. In most cases, the issue can be resolved by limiting SSH identities, cleaning up the SSH agent, or correcting the client configuration.

    To minimize future authentication issues, follow SSH best practices such as using dedicated identity files, managing SSH keys carefully, and regularly reviewing access settings.

    For VMware environments, it’s also important to be prepared for unexpected infrastructure issues beyond SSH access. A reliable VMware backup solution like Info2soft i2Backup helps protect virtual machines and enables fast recovery, ensuring business continuity even when administrative access is temporarily unavailable.

    Dylan has 8+ years of experience in enterprise data management, server optimization, and disaster recovery. He specializes in translating complex technical concepts into actionable guides for IT administrators and DevOps teams, with a focus on data security, cloud migration, and business continuity.

    More Related Articles

    Table of Contents:
    Stay Updated on Latest Tips
    Subscribe to our newsletter for the latest insights, news, exclusive content. You can unsubscribe at any time.
    Subscribe
    Ready to Enhance Business Data Security?
    Start a 60-day free trial or view demo to see how Info2soft protects enterprise data.
    Please fill out the form and submit it, our customer service representative will contact you soon.
    By submitting this form, I confirm that I have read and agree to the Privacy Notice.
    {{ isSubmitting ? 'Submitting...' : 'Submit' }}