为什么无法通过 SSH 登录服务器?

为什么无法通过 SSH 登录服务器?

网络连接正常,我可以 ping 该服务器。但是,我无法通过任何用户 SSH 访问它。输出如下,

Auth User/Pass with PS...fail...Please reconnect!.
Connection to xxx closed.

我的密码没有问题。是由于平均负载过高或配置错误造成的吗?

这是输入密码后的详细输出,

debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US
Auth User/Pass with PS...fail...Please reconnect!.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to xxx closed.
Transferred: sent 1640, received 1256 bytes, in 0.2 seconds
Bytes per second: sent 7131.6, received 5461.8
debug1: Exit status 0

答案1

从一些基础知识开始。

  • 服务器是否运行了SSH服务?
  • 服务器上是否打开了适当的端口?
  • 服务器会接受来自客户端地址的 SSH 连接吗?
  • 您是否尝试通过正确的端口访问它?

答案2

如果您从服务器 ssh 到 127.0.0.1,是否会出现相同的错误?我在使用 ssh 时遇到问题,结果发现是身份验证密钥损坏。

另外,你使用的是哪个版本的 Linux?请注意,在某些发行版中,默认情况下 root 无法通过 ssh 登录

您可以运行 top 来查看是否有失控进程。除非您的服务器真的非常繁忙,否则我认为 ssh 仍然会正常工作。

答案3

我刚刚遇到了错误“使用 PS 验证用户/密码...失败...请重新连接!“,事实证明我试图连接到 IPMI 地址而不是主机本身。

希望有帮助!

相关内容