Why am I Getting an Incorrect Password Error When Logging into My Server via VNC? Print

  • 0

Encountering an "incorrect password" error when trying to log into your server via VNC can disrupt access to your VPS, especially during critical troubleshooting or setup tasks. This issue often arises from configuration mismatches, user errors, or server-side settings rather than an actual security breach. VNC (Virtual Network Computing) provides graphical access to remote servers, but its authentication can be finicky, particularly on Linux-based VPS environments. This guide explores common reasons and offers practical steps to resolve the problem, drawing from typical setups like those using KVM virtualization.

Common Causes of the Error

Understanding the root cause helps in efficient troubleshooting. Here are frequent culprits:

  • Typing or Keyboard Layout Issues: Simple input errors, such as caps lock being on or a mismatched keyboard layout (e.g., QWERTY vs. QWERTZ, where 'y' and 'z' keys are swapped), can make the password seem incorrect. This is common when connecting from different regional settings.
  • Password Not Set or Outdated: If the VNC server hasn't had a password provisioned using tools like vncpasswd, or if it's been changed but not updated in your client, authentication fails. VNC passwords are stored in encrypted files and must be exactly 5-8 characters long—longer ones are truncated.
  • Configuration Mismatches: On the server, improper VNC setup (e.g., using x11vnc or TightVNC) might lead to password check failures due to file permissions, encoding issues, or version incompatibilities between client and server.
  • Control Panel-Specific Settings: For VPS providers using management panels like SolusVM (as seen with VPS.DO), the VNC password might be managed separately from the root password and require resetting through the dashboard, especially after OS reinstalls or reboots.
  • Client-Side Problems: Your VNC viewer (e.g., RealVNC, TightVNC) could have cached wrong credentials, or network/firewall blocks might interrupt the authentication process.
  • Server-Side Restrictions: Firewalls, SELinux policies, or even low resources on the VPS can indirectly cause authentication errors by preventing proper VNC service operation.

Step-by-Step Troubleshooting

Follow these steps in order. You'll need alternative access like SSH (for Linux) to make server-side changes. If SSH is unavailable, use your VPS provider's console access.

Step 1: Verify Basic Input

  • Double-check the password for typos. Ensure caps lock is off and try typing it in a notepad first.
  • Test for keyboard layout issues: If using a non-English layout, switch to US English in your VNC client settings. For example, type 'password' as if keys were reversed (e.g., press 'z' for 'y').
  • Clear any cached credentials in your VNC viewer and re-enter them.

Step 2: Reset the VNC Password on the Server

If you have SSH access:

  • Log in via SSH: ssh root@your-server-ip.
  • Set or reset the VNC password: vncpasswd. Enter a new password (5-8 characters) when prompted.
  • Restart the VNC service: Depending on your setup, use systemctl restart vncserver@1 (for systemd) or /etc/init.d/vncserver restart.
  • For x11vnc users: Check permissions on ~/.vnc/passwd with chmod 600 ~/.vnc/passwd.

If no SSH, use your provider's control panel. In systems like SolusVM (utilized by VPS.DO for VNC console access), log into the panel, select your VPS, navigate to the VNC tab, enter a new password, and reboot the server to apply changes.

Step 3: Check Server Configuration

  • Ensure the VNC server is running: Via SSH, run ps aux | grep vnc to confirm.
  • Review logs for clues: Check /var/log/vnc.log or journalctl -u vncserver for authentication errors.
  • Disable firewalls temporarily: ufw disable (Ubuntu) or firewalld stop (CentOS), then test. Re-enable after.
  • Confirm VNC port (usually 5900+): Use netstat -tuln | grep 590 to see if it's listening.

Step 4: Test with Different Clients or Networks

  • Switch VNC viewers: Try TightVNC if using RealVNC, or vice versa.
  • Connect from another device or network to rule out local issues.
  • If using a VPS console, attempt direct access via the provider's built-in VNC tool to bypass external clients.

Step 5: Reinstall or Reconfigure VNC

As a last resort:

  • Reinstall VNC server: On Ubuntu, apt purge tightvncserver && apt install tightvncserver.
  • Reboot the VPS: This often resolves session glitches.
  • If persistent, consider OS reinstall via your control panel, but back up data first.

Prevention Tips

  • Use strong, memorable passwords and store them securely in a manager.
  • Standardize keyboard layouts across devices.
  • Regularly update your VNC software and server OS to avoid compatibility bugs.
  • Opt for SSH tunneling for VNC (e.g., ssh -L 5901:localhost:5901 user@server) for added security and stability.
  • Monitor server resources to prevent overload-related failures.

If these steps don't work, the issue might stem from provider-specific configurations or hardware emulation in virtualized setups. Reach out to support with error logs for tailored assistance. Resolving VNC password errors typically restores access quickly, allowing you to focus on your server's core tasks.


Was this answer helpful?

« Back