ssh無法登錄,提示Connection closing...Socket close.


一、問題無法ssh直接連接到服務器

[C:\~]$ ssh 192.168.7.77

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

Connection closed by foreign host.

Disconnected from remote host(192.168.7.77:22) at 16:51:19.

二、問題原因及解決方法

sshd的配置,自己的IP地址沒有加入到hosts.allow配置文件中,而hosts.deny則拒絕了除allow外的所有主機登錄。

解決方法:把自己的IP地址加入到hosts.allow文件中,並重啟sshd服務。

# ll /etc/hosts.*
-rw-r--r-- 1 root root 767 Jan  2  2017 /etc/hosts.allow
-rw-r--r-- 1 root root 888 Aug 15  2016 /etc/hosts.deny
# grep -Ev '#' /etc/hosts.deny 
sshd:all
# grep -Ev '#' /etc/hosts.allow 
sshd:192.168.7.100/255.255.255.255


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM