XSHELL篇 — xshell突然连接不上-报错:Socket error Event: 32 Error: 10053. Connection closing...Socket close.

我的阿里云服务器今天突然连接不上

在xshel连接报错:
 

Connecting to 39.100.144.30:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Socket error Event: 32 Error: 10053.
Connection closing...Socket close.

Connection closed by foreign host.

Disconnected from remote host(39.100.144.30) at 09:55:41.

Type `help' to learn how to use Xshell prompt.

 

在终端登录查看信息

# service sshd status
sshd[7794]: Failed password for invalid user admin from 45.224.105.95 port 42423 ssh2
sshd[10205]: Invalid user sniffer from 123.21.253.168 port 60809
sshd[10205]: error: Could not get shadow information for NOUSER
sshd[10205]: Failed password for invalid user sniffer from 123.21.253.168 port 60809 ssh2
sshd[24284]: Invalid user admina from 14.187.177.87 port 56323
sshd[24284]: error: Could not get shadow information for NOUSER
sshd[24284]: Failed password for invalid user admina from 14.187.177.87 port 56323 ssh2
sshd[25822]: Accepted password for root from 47.96.60.110 port 2099 ssh2
sshd[25827]: Accepted password for root from 47.96.60.213 port 37498 ssh2
sshd[25847]: Accepted password for root from 47.96.60.214 port 14030 ssh2

 

查看日志

# cat /var/log/messages |grep error
 sshd[598]: error: kex_exchange_identification: Connection closed by remote host
 sshd[2747]: error: kex_exchange_identification: Connection closed by remote host
 sshd[27038]: error: kex_exchange_identification: Connection closed by remote host
 sshd[7787]: error: Could not get shadow information for NOUSER
 sshd[7794]: error: Could not get shadow information for NOUSER
 sshd[29152]: error: kex_exchange_identification: Connection closed by remote host
 sshd[10205]: error: Could not get shadow information for NOUSER
 sshd[11128]: error: kex_exchange_identification: read: Connection reset by peer
 sshd[12179]: error: kex_exchange_identification: Connection closed by remote host
 sshd[23249]: error: kex_exchange_identification: Connection closed by remote host
 sshd[24281]: error: kex_exchange_identification: Connection closed by remote host
 sshd[24284]: error: Could not get shadow information for NOUSER
 sshd[25067]: error: kex_exchange_identification: Connection closed by remote host
 sshd[25076]: error: kex_exchange_identification: Connection closed by remote host
 sshd[26628]: error: kex_exchange_identification: Connection closed by remote host
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

最后查出是网络的问题。连接手机热点就可以登录服务器。【抓狂】

 

中间鬼使神差的,重启sshd服务,重启服务器,重置密码导致在云控制台登录时出现以下情况

解决:/etc/ssh/sshd_config配置文件中  #UsePAM no  参数去掉 #号  ,重启sshd服务后好了,

 

好在ssh不能连接时,还可以用VNC连接。

之后为了确认是否是这个参数影响的,做好快照后,又把参数 #UsePAM no   的#号加上了,重启sshd服务后,依旧可以用ssh方式登录,此时我就有些摸不着头脑了????????????????????????????????????

UsePAM是的openssh中的一个pam证书验证模块,默认是启用的

网上有些是因为启用了pam导致登录失败

有些是因为没有启用登录失败

不懂啊!!!全网 唯一 一篇对于PAM的介绍 《保护ssh的三把锁》【反正公子这么认为】

 

  • 总结检查思路

1、更换网络再次登录测试【强烈推荐首先尝试

2、selinux机制是否关闭【确认已经关闭】

3、检查/etc/ssh/sshd_config配置文件中  #UsePAM no  

 

 

  • 6
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值