Authentication method password not supported by the server at this stage

本文介绍了解决ESXi服务器SSH密码认证失败的方法。主要原因是PasswordAuthentication默认关闭,需修改sshd_config文件启用并重启SSH服务。适用于遇到类似问题的技术人员。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题描述

通过 java 远程执行命令获取 ESXi 服务器的 thumbprint 字符串时报密码授权失败错误,错误信息如下:

java.io.IOException: Password authentication failed.
at ch.ethz.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:300) 
at ch.ethz.ssh2.Connection.authenticateWithPassword(Connection.java:309) 
at test.demo.TestSSH.main(TestSSH.java:19) 
Caused by: java.io.IOException: Authentication method password not supported by the server at this stage. 
at ch.ethz.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:270)
问题原因

ESXi 服务器(内核为 linux)的 ssh 服务中的 PasswordAuthentication 默认是不可用的,而且需确保允许 root 用户登录。

解决方法

所以只需要将 ssh 服务中的 PasswordAuthentication 启用即可,启用方法如下:

1、修改 sshd_config 文件,命令为:vi /etc/ssh/sshd_config ;

2、将 #PasswordAuthentication no 的注释#去掉,并且将 no 修改为 yes;

3、将 #PermitRootLogin yes 的注释#去掉,一般默认是打开的;

4、重新启动 SSH 服务,命令为:/etc/init.d/SSH restart ;

SSH login disabled
SSH login enabled

5、验证 SSH 服务状态,命令为:/etc/init.d/SSH status;

SSH login is started




参考:
如何开启ssh服务

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值