服务器能ping通,ssh却连不上

问题现象:

1、原来用Xshell连着的窗口能正常操作

2、重新打开新的窗口却提示:

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

Last login: Tue Jul 17 23:41:28 2018 from 192.168.94.163
Connection closing...Socket close.

Connection closed by foreign host.

Disconnected from remote host(192.168.36.61) at 15:53:56.

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

找了好久都不知道为什么会这样,然后网上搜到一篇文章,找到了灵感,跟我的情况类似

地址:https://www.cnblogs.com/outo/p/3779478.html

问题源头:/etc/security/limits.conf

因为我后台部署elasticsearch 会去自动修改/etc/security/limits.conf中的配置,而最后一次部署过程中出现问题,删除了/etc/security/limits.conf文件,导致新的shell再也无法连接上。

猜你喜欢

转载自blog.csdn.net/zou79189747/article/details/81082818