[精讚] [會員登入]

[Unix-like] SSH 的除錯模式

當ssh連線錯誤或失敗時,不知道問題在哪?也許可以試試用ssh本身的debug模式來查錯

分享完整連結 //n.sfs.tw/m10199

分享連結 [Unix-like] SSH 的除錯模式@精讚
(文章歡迎轉載,請尊重版權註明連結來源)
2017-01-23 19:03:10 By 張○○

這近遇到伺服器的SSH連線一半就斷線,常常發生在下載檔案的時候,重連又可以,不知問題在哪?

進入SSH的除錯模式 -v

這樣就會把連線詳細的狀態寫出來

# ssh -v -l axer 60.249.x.x
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 60.249.x.x [60.249.x.x] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '60.249.x.x' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:7
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
axer@60.249.x.x's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = zh_TW.UTF-8
Last login: Wed Jan 18 11:12:53 2017 from 111-83-47-79.emome-ip.hinet.net

你可以得到比原本更多的資訊


原文 2011-11-01 22:37:37

END
你可能有興趣

[Rocky9] 安裝node.js 18, node.js 20

原本的nodejs16在使用 quasar dev時出現錯誤,得升級成18版以上

[SSL] Could not read certificate from server.cer 的錯誤排除

在轉換ssl憑證時,出現無法讀取的錯誤,可是怎麼看憑證都很正常,該怎麼解決?

[Linux] 如何能知道我是什麼時候安裝系統的?

linux想知道什麼時候裝系統的? 不必憑記憶。

地圖填色的網站

我們想為國家填色不需要小畫家,這個網站能幫助你

[Linux] 列出所有目錄及所占空間的方法

想知道目錄下的所有目錄所占的空間大小?

[Linux] grep 排除特定字串

使用 -v 參數可以讓grep排除特定字串的方法