ssh 用xshell远程连接,连接不上
Posted renliping
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ssh 用xshell远程连接,连接不上相关的知识,希望对你有一定的参考价值。
Nov 3 19:31:35 fqhy_devlp sshd[8195]: Server listening on 0.0.0.0 port 22.
136 Nov 3 19:31:47 fqhy_devlp sshd[8206]: refused connect from 101.254.207.4 (101.254.207.4)
137 Nov 3 19:43:21 fqhy_devlp sshd[8576]: refused connect from 101.254.207.4 (101.254.207.4)
138 Nov 3 19:43:52 fqhy_devlp sshd[8602]: refused connect from 101.254.207.4 (101.254.207.4)
139 Nov 3 19:44:36 fqhy_devlp sshd[8648]: Accepted password for yuanwz from 101.254.207.4 port 52700 ssh2
140 Nov 3 19:44:36 fqhy_devlp sshd[8648]: pam_unix(sshd:session): session opened for user yuanwz by (uid=0)
141 Nov 3 19:44:49 fqhy_devlp sshd[8681]: refused connect from 101.254.207.4 (101.254.207.4)
142 Nov 3 19:47:47 fqhy_devlp sshd[8746]: refused connect from 101.254.207.4 (101.254.207.4)
143 Nov 3 19:55:45 fqhy_devlp sshd[8195]: Received signal 15; terminating.
使用默认的配置登录不上,偶尔登录上,会把IP写入/etc/hosts.deny,清空该文件后,依然会写入
解决办法:
在/etc/hosts.allow 里 写入 sshd:ALL即可
去掉下面几行,即不限制IP登录
#AllowUsers [email protected],123.57.163.30
#AllowUsers [email protected],211.157.155.70,125.33.251.149,182.92.236.4,211.157.155.67
#AllowUsers [email protected],123.57.163.30,182.92.236.4,125.33.251.109,211.157.155.67,1.12.193.199,1.15.24.16
#AllowUsers [email protected],123.57.163.30
#AllowUsers [email protected],123.57.163.30,125.33.251.149,223.223.195.226,211.157.155.67
#AllowUsers [email protected]
#AllowGroups sshgroup
#AllowGroups dev
以上是关于ssh 用xshell远程连接,连接不上的主要内容,如果未能解决你的问题,请参考以下文章