1. 程式人生 > >ssh 提示Connection closed by * 的解決方案

ssh 提示Connection closed by * 的解決方案

檢視ssh服務端的日誌 [email protected]:~$ cat /var/log/auth.log Jun 20 16:55:26 tegra-ubuntu sshd[1192]: Server listening on 0.0.0.0 port 22. Jun 20 16:55:26 tegra-ubuntu sshd[1192]: Server listening on :: port 22. Jun 20 16:55:27 tegra-ubuntu login[1313]: pam_unix(login:session): session opened for user ubuntu by
LOGIN(uid=0) Jun 20 16:55:28 tegra-ubuntu lightdm: pam_unix(lightdm-autologin:session): session opened for user ubuntu by (uid=0) Jun 20 16:55:31 tegra-ubuntu polkitd(authority=local): Registered Authentication Agent for unix-session:c2 (system bus name :1.60 [/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) Jun 20 16:56:16 tegra-ubuntu sshd[2145]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key Jun 20 16:56:16 tegra-ubuntu sshd[2145]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key Jun 20 16:56:16 tegra-ubuntu sshd[2145
]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key Jun 20 16:56:16 tegra-ubuntu sshd[2145]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key Jun 20 16:56:16 tegra-ubuntu sshd[2145]: fatal: No supported key exchange algorithms [preauth] [email protected]:~$ [email protected]:~$ ll /etc/ssh total 268 drwxr-xr-x 2 root root 4096 Jan 1 1970 ./ drwxr-xr-x 133 root root 12288 Jun 20 16:55 ../ -rw-r--r-- 1 root root 242091 Apr 2 2015 moduli -rw-r--r-- 1 root root 1690 Apr 2 2015 ssh_config -rw-r--r-- 1 root root 2541 Apr 2 2015 sshd_config -rw------- 1 root root 0 Jan 1 1970 ssh_host_dsa_key -rw-r--r-- 1 root root 0 Jan 1 1970 ssh_host_dsa_key.pub -rw------- 1 root root 0 Jan 1 1970 ssh_host_ecdsa_key -rw-r--r-- 1 root root 0 Jan 1 1970 ssh_host_ecdsa_key.pub -rw------- 1 root root 0 Jan 1 1970 ssh_host_rsa_key -rw-r--r-- 1 root root 0 Jan 1 1970 ssh_host_rsa_key.pub -rw-r--r-- 1 root root 338 Apr 2 2015 ssh_import_id [email protected]:~$ 重新生成金鑰 sudo ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key [email protected]:~$ ll /etc/ssh total 292 drwxr-xr-x 2 root root 4096 Jan 1 1970 ./ drwxr-xr-x 133 root root 12288 Jun 20 16:59 ../ -rw-r--r-- 1 root root 242091 Apr 2 2015 moduli -rw-r--r-- 1 root root 1690 Apr 2 2015 ssh_config -rw-r--r-- 1 root root 2541 Apr 2 2015 sshd_config -rw------- 1 root root 668 Jan 1 1970 ssh_host_dsa_key -rw-r--r-- 1 root root 607 Jan 1 1970 ssh_host_dsa_key.pub -rw------- 1 root root 227 Jan 1 1970 ssh_host_ecdsa_key -rw-r--r-- 1 root root 179 Jan 1 1970 ssh_host_ecdsa_key.pub -rw------- 1 root root 1679 Jan 1 1970 ssh_host_rsa_key -rw-r--r-- 1 root root 399 Jan 1 1970 ssh_host_rsa_key.pub -rw-r--r-- 1 root root 338 Apr 2 2015 ssh_import_id [email protected]:~$ 客戶端重新登入,提示 [email protected]:~$ ssh [email protected]192.168.0.224 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the DSA key sent by the remote host is 89:5a:d2:79:cc:66:7c:5e:dd:64:ef:05:dd:83:25:e1. Please contact your system administrator. Add correct host key in /home/tirvideo/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /home/tirvideo/.ssh/known_hosts:2 remove with: ssh-keygen -f "/home/tirvideo/.ssh/known_hosts" -R 192.168.0.224 DSA host key for 192.168.0.224 has changed and you have requested strict checking. Host key verification failed. 清除當前的金鑰 [email protected]:~$ ssh-keygen -f "/home/tirvideo/.ssh/known_hosts" -R 192.168.0.224 # Host 192.168.0.224 found: line 2 type ECDSA /home/tirvideo/.ssh/known_hosts updated. Original contents retained as /home/tirvideo/.ssh/known_hosts.old [email protected]:~$ 重新登入即可 [email protected]:~$ ssh [email protected]192.168.0.224 The authenticity of host '192.168.0.224 (192.168.0.224)' can't be established. DSA key fingerprint is 89:5a:d2:79:

相關推薦

ssh 提示Connection closed by * 的解決方案

檢視ssh服務端的日誌 [email protected]:~$ cat /var/log/auth.log Jun 20 16:55:26 tegra-ubuntu sshd[1192]: Server listening on 0.0.0.0 port 22. Jun 20 16:55:26 t

ssh連接提示 "Connection closed by remote host"

tail sdn edi who text 日誌 b2c closed blank 如果原來是可以用ssh連接的, 突然連接不上通常是連接數過多導致的. 解決方法一. 把SSH連接數改大 修改服務器上的這個文件:/etc/ssh/sshd_config 找到這行: #

【Linux】使用Xshell通過ssh連線linux出現Connection closed by foreign host.提示

一般我們都會使用crt或xshell通過ssh協議去連線Linux伺服器進行操作,最近遇到了一個問題,在通過xshell連線linux伺服器過程中出現Connection closed by foreign host.中文:外部主機關閉連線好吧,雖然知道中文意思,但是感覺毫無卵用。隨後使

解決 SSH Connection closed by foreign host

Xshell 報錯 : 1.有可能是IP和別人衝突,改一下IP就好了 2.也有可能是檔案許可權的問題。改一下: cd /etc/ssh/ chmod 600 ssh_host_* chmod 644 *.pub 3.也有可能是防火牆的問題

Xshell ssh 連接後一段時間就掉線 Connection closed by foreign host

ror ade 訪問 open option 時間 status pan sys 問題現象: 發現本機sshd服務開啟但是其他機器不能登陸 Xshell ssh 連接後一段時間就掉線 Connection closed by foreign host 查看sshd服務

Connection closed by foreign host原因ip衝突及解決辦法

使用xshell連線centos時總自動斷開,按網上的修改探尋報文週期方法試了,也沒用,突然發現換了一個無線網後,竟然不會斷開了,於是猜想是不是ip衝突導致,而且報錯資訊也提示連線被客戶機關閉 先連線會自動斷開的無線網==》ipconfig==》192.168.1.104 虛擬機器給cent

SSH Connection closed by window cygwin

1. 背景 使用者A從Linux上ssh 到 window Server2008(已經安裝cygwin和配置了SSH),報下面問題 --------------------------------------- ssh window64.com.cnConnection closed by

scp時候出現ssh Connection refused的解決方案

在從別的機子上拷貝東西時,出現如下錯誤,找了下問題,也就是說是我沒有在本機建立ssh服務 ssh: connect to host 192.168.1.118 port 22: Connection refused lost connection 需要安裝服務模組o

SSH的詳細安裝步驟及登入提示:connection refused的解決辦法

如果出現ssh: connect to host XX.XX.XX.XX port 22: Connection refused 請按如下步驟檢查: 1、目標主機的ssh server端程式是否安裝、服務是否啟動,是否在偵聽22埠; 檢查方法: [email

修改sshd_config解決 xshell 連結 linux 錯誤 connection closed by foreign host

用xshell連線伺服器總是報錯 connection closed by foreign host,害的我一個程式每次都跑到一半 解決方案是:     sudo vim /etc/ssh/sshd_config 新增兩行: ClientAliveInterval 6

ssh_exchange_identification: Connection closed by remote host 解決方法

share conn linux 註釋 etc all allow linu 執行 ssh_exchange_identification: Connection closed by remote host 解決方法問題描述:在linux主機上ssh 另一臺主機的內網地址報

ssh連線報Connection closed by foreign host.

今天連線linux時居然連不上,報錯資訊是: Connecting to 192.168.16.133:22... Connection established. To escape to local

ssh 安裝及登入提示:connection refused的解決辦法

分客戶端openssh-client和openssh-server如果你只是想登陸別的機器的SSH只需要安裝openssh-client(ubuntu有預設安裝,如果沒有則sudo apt-get install openssh-client),如果要使本機開放SSH服務就需要安裝openssh-serve

SSH連線伺服器報ssh_exchange_identification: Connection closed by remote host

下午發現公司有臺圖片伺服器不能SSH遠端連線了,從內網的其它伺服器上ssh也不能連線,都是報:ssh_exchange_identification: Connection closed by remote host 眾所周知的原因,現在google搜尋不翻牆暫時用不了,用

SSH無法連線:Connection closed by foreign host

之前一直好好的,今天突然連線不上了,報一個什麼Connection closed by foreign host的錯: (圖片引用網路) 解決方法 連線管理終端,執行如下命令: (圖片引用網路) 最後重啟sshd的路徑不一定和教程一樣,要找到自己的sshd路徑進行重

Connection closed by foreign host無法連接linux

connection closed by 環境,在win7系統下的虛擬機,虛擬機系統為centos6.6由於windows長時間沒有關機,然後今天電腦就感覺卡了就重啟一下,結果重啟了,linux鏈接不上了,如下:Connecting to 192.168.10.186:22... Connecti

關於xshell:Connection closed by foreign host

shel 連接 conn xmanager for 超時 服務 無效 nbsp 因為原來系統網有時掉,有時卡(同局域網別人沒事),重新做了系統。 裝了xmanager3,在用xshell連接linux服務器時,提示:服務器發送了一個無效的密鑰,然後輸出:Connection

RHEL7 Connection closed by foreign host.

connection closed by 今天連接linux時居然連不上,報錯信息是:Connecting to 10.10.10.116:22...Connection established.To escape to local shell, press ‘Ctrl+Alt+]‘.Connec

Connection closed by foreign host

xshell linux遠程登錄 今天啟動了三個虛擬機,ip分別是101,102,103,使用xshell登錄101和102登錄成功了,另外一個103登錄就提示:connection closed by foreign host。剛才出去之前還是可以登錄的,那時候使用的網線,現在沒有用網線,使用的wi

ubuntu 提示 NO PUBLIC KEY 解決方案

iter string pan comm ring 方案 server serve bsp 運行以下命令 記得將KEY改成自己的KEY sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126