ssh問題:ssh_exchange_identification: Connection closed by remote host
轉自:
剛剛一個朋友告訴我SSH連線不上伺服器了,重啟電腦也不管用.我仔細看了一下,老報如下錯誤:
ssh_exchange_identification: Connection closed by remote host
the connection to the remote host was lost . this usually means that you network connection went down or that the remote host was rebooted
most network outages are short. and thus trying again may work
我在網上google了一下,得解決方案:
最簡單的解決方法就是讓/etc/hosts.allow 和/etc/hosts.deny裡面的所有資訊都不生效,全部登出掉,重啟SSH服務就可以了.
下面是別人的文章:
解決方法
主要是 /etc/hosts.allow 和 /etc/hosts.deny問題 最好兩個都設定一下。
因為有些系統是先load hosts.allow 再 load hosts.allow .有些相反。
hosts.allow:
ALL:ALL:allow sshd sshd1 sshd2:ALL:allow #ssh:0.0.0.0/0.0.0.0 sshd:192.168.1.:allow hosts.deny sshd[2760]:
# you should know that NFS uses portmap!
ALL:ALL EXCEPT 127.0.0.1:DENY to ALL:ALL EXCEPT 127.0.0.1 AND 192.168.1.111:DENY
完成後。重啟sshd :
service sshd restart /etc/init.d/sshd restart
如果還不行就查一下syslog
位置在 /var/log/syslog
在那可以看到為什麼不行。再改一下。再測試一下。反正都要多試幾種方法
....
....refused connect from ::ffff:192.168.*.*...
.........
上個星期去 google查的時候發再外國有位仁兄,超搞笑。他出現這個問題後。也搞了很久,但是還不行。然後他就不想理它了,出去玩。回來後就可以連線上了。於是我想我也把網線拔了。等了兩天發現還是不行啊。所以說外國的經驗還是不能照套的。
我在想,上baidu找一下吧,發現只有提問的。沒有回答的。百度知道根本都沒有這個問題。只能上google了,還好,找到了一些眉目,於是就嘗試鎖定hosts。全英對我沒有什麼問題,外語大學的嘛,找找看。設定一下,
發現sshd_conf是沒問題的。
記得重點放要在hosts.allow和hosts.deny那。
並且log日誌很重要的。所以我也看了大半天的網上日誌資料。(
文章出處:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22036495/viewspace-1047865/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- REMOTE HOST IDENTIFICATION HAS CHANGED 問題解決REMIDE
- ssh: connect to host localhost port 22: Connection refusedlocalhost
- 求助:移動端登入測試,報錯 RemoteDisconnected Remote end closed connection without response。REM
- 免密scp解決ssh_exchange_identification:read connection reset by peer 原因IDE
- EJB create時ConnectException: Connection refused to host:....問題Exception
- SSH登入:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- Linux - SSH: WARNING REMOTE HOST IDENTIFICATION HAS CHANGEDLinuxREMIDE
- ORA-12537: TNS:connection closed問題解決
- SSH登入警告(WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)REMIDE
- ssh登陸 “remote host identification has changed!“ 解決方案REMIDE
- 【Oracle】ORA-12537: TNS:connection closed 問題處理Oracle
- ora-12537 TNS:connection closed的問題處理
- ssh無法連線 WARNING REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- SSH登陸錯誤 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- 坑:ssh: connect to host github.com port 22: Connection refusedGithub
- rhel5上配置vsftpd_421 Service not available, remote server has closed connectionFTPAIREMServer
- ssh連線Linux收到The remote system refused the connection報錯LinuxREM
- ssh連線遠端伺服器出現Host key verification failed. lost connection問題的解決伺服器AI
- SSH遠端登入問題:network error:no route to hostError
- 異常解決——GitLab : ssh: connect to host port 22: Connection refusedGitlab
- Connection could not be established with host 求救
- linux之 ssh連線伺服器,WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!Linux伺服器REMIDE
- SSH Host key verification failedAI
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- 【MySQL】Host is blocked because of many connection errorsMySqlBloCError
- ubuntu ssh: connect to host ** port 22: Connection refused ssh登入遠端伺服器時提示Permission denied (publickey,password)Ubuntu伺服器
- 【Mysql】MySql Host is blocked because of many connection errors;MySqlBloCError
- ascp: Failed to open TCP connection for SSH, exiting. Session Stop (Error: Failed to open TCP connection for SSH)AITCPSessionError
- [network][easy case]troubleshoting the connection to a remote serverREMServer
- Solaris SSH 服務處於maintenance模式,ssh connection refusedAINaN模式
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED解決方法REMIDE
- Windows遠端桌面的使用(Remote Desktop Connection)WindowsREM
- 1 Million TCP Connection 問題解決TCP
- Xlib: connection to ":0.0" refused by server 問題Server
- Mysql host is blocked because of many connection errors;unblock解決方法MySqlBloCError
- RAC Connection Redirected To Wrong Host/IP ORA-12545
- Github ssh的連線問題Github
- 解決SSH亂碼問題