SSH登入慢的問題解決方案

來源:互聯網
上載者:User

SSH登入慢的問題解決方案 就我自身所遇到的情況來看, 這些延遲絕大部分是 GSSAPI 的認證功能導致的! 你可以用 -v  選項確認你的情況. 例如, 下面是 ssh 的詳細登陸過程:  [root@xuekun ~]# ssh -v xuekun@192.168.15.120 ... ... debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,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   debug1: Next authentication method: publickey debug1: Trying private key: /home/xuekun/.ssh/identity debug1: Trying private key: /home/xuekun/.ssh/id_rsa debug1: Trying private key: /home/xuekun/.ssh/id_dsa debug1: Next authentication method: password xuekun@192.168.15.120's password:  解決方案 就我所遇到的情況來看, 顯然是要把 GSSAPI 禁用. 以下是三種可行的方式: [注] 該解決方案是在用戶端 OpenSSH_4.7p1 centos5.8 centos6.2下測試並通過的. 1. 串連時用命令指定:  ssh -o GSSAPIAuthentication=no xuekun@192.168.15.127  2. 在 ssh 用戶端程式的設定檔裡顯式禁用 GSSAPI 認證. 如, 編輯 /etc/ssh/ssh_config 檔案, 添加或修改使其有如下一行:  GSSAPIAuthentication no  3. 在使用者根目錄下的 .ssh 目錄下建立一個 config 檔案. 如, 編輯 /home/xuekun/.ssh/config (如果該檔案不存在, 則建立之), 添加選項:  GSSAPIAuthentication no  [注] A. /etc/ssh/ssh_config 是全域設定檔, 對其進行的修改會影響所有使用 ssh 用戶端的系統使用者.         B. /home/cherry/.ssh/config 是只會影響使用者 xcl 的本地 ssh 用戶端設定檔. 該檔案的所有配置參數會覆蓋全域設定檔的相同配置參數. 在禁用 GSSAPI 後, ssh 的登陸提示 "迴歸" 正常了:  [root@xuekun ~]# ssh -v xuekun@192.168.15.127 ... ... debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Next authentication method: publickey debug1: Trying private key: /home/xuekun/.ssh/identity debug1: Trying private key: /home/xuekun/.ssh/id_rsa debug1: Trying private key: /home/xuekun/.ssh/id_dsa debug1: Next authentication method: password xuekun@192.168.15.127's password:  可見, 該過程已經不再使用 GSSAPI 了. 速度也大大提高了. 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.