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 了. 速度也大大提高了.