侧边栏壁纸
博主头像
liveJQ博主等级

沒有乐趣,何来开始

  • 累计撰写 103 篇文章
  • 累计创建 50 个标签
  • 累计收到 2 条评论

SSH 连接被远程主机关闭

liveJQ
2021-10-15 / 0 评论 / 0 点赞 / 38 阅读 / 956 字 / 正在检测是否收录...

🚩场景的转换往往会带来新的问题,“以不动应万变”也不是没有道理的。

平时在办公室上班没有发现,今天心血来潮,在家远程时竟然无法登陆了😖

Connecting to 45.xxx.xx.xxx:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Connection closing...Socket close.

Connection closed by foreign host.

Disconnected from remote host(45.xxx.xx.xxx) at 19:41:50.

在办公室能连得上,在家无法连接,已经可以排除大部分因服务所导致的各种杂症了。网上寻因无果,最后可以推测得出,唯一的可能就只有“限制登录”这种情况了。

[root@localhost ~]# vi /etc/hosts.allow 

#
# hosts.allow   This file contains access rules which are used to
#               allow or deny connections to network services that
#               either use the tcp_wrappers library or that have been
#               started through a tcp_wrappers-enabled xinetd.
#
#               See 'man 5 hosts_options' and 'man 5 hosts_access'
#               for information on rule syntax.
#               See 'man tcpd' for information on tcp_wrappers
#
sshd:61.28.64.*:allow
sshd:223.73.*.*:allow
sshd:14.18.*.*:allow
sshd:183.3.151.*:allow
sshd:58.248.30.*:allow
sshd:103.205.121.*:allow
sshd:45.124.*.*:allow
sshd:114.119.*.*:allow
sshd:10.*.*.*:allow
sshd:123.108.*.*:allow
sshd:175.102.19.*:allow

从上面可以看出,主机做了限制登录的操作,只允许特定范围的 IP 登录。

0

评论区