Accessing ESXi SSH using username and password not working
search cancel

Accessing ESXi SSH using username and password not working

book

Article ID: 428184

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

You try to access ESXI SSH using Putty or other SSH client but receiving messages similar to:

 

  • Disconnected :No supported authentication method available (server sent: public key) 
  • SSH client login failed

 When you try  directly from vCenter shell using following command

ssh root@ESXI-FQDNorIP

you get message 

  • ssh: connect to host ESXI-FQDNorIP port 22: Connection refused

 

You are able to access ESXI UI or DCUI using same user and credentials.

 

You connect to ESXI using DCUI and check that SSH service is running using command 

  • /etc/init.d/SSH status

 

After confirming that service is up and running run following to get more information's

  • ssh -vvv 127.0.0.1

 

In output you see similar entries 

 

  • debug1: Authentications that can continue: publickey

 

This is indicating that keyboard-interactive authentication method is disabled in /etc/ssh/sshd_config

 

 

Environment

ESXi 8.x

Cause

Previous changes on ESXi were done following this article 

Allowing SSH access to VMware vSphere ESXi/ESX hosts with public/private key authentication

Resolution

Modify "challengeresponseauthentication no" to "challengeresponseauthentication yes" in /etc/ssh/sshd_config

 

Open DCUI following 

Accessing DCUI/Console of ESXi using ALT+F Keys

 

Navigate to location /etc/ssh

Then take backup of the sshd_config file 

 

cp sshd_config sshd_config.bak

 

Then using text editor find correct line 

 

challengeresponseauthentication no

 

and change it to 

 

challengeresponseauthentication yes

 

Restart ssh service with following command

/etc/init.d/SSH restart


Try SSH login again.