ssh连接很慢GSS failure解决办法
来源:互联网 发布:网络女主播真实收入 编辑:程序博客网 时间:2024/05/16 08:31
什么导致了 scp 和 ssh 的登陆提示速度下降
就我自身所遇到的情况来看, 这些延迟绝大部分是 GSSAPI 的认证功能导致的!
你可以用 -v 选项确认你的情况. 例如, 下面是 ssh 的详细登陆过程:
cherry@cherry:~$ ssh -v cherry@59.151.47.49
...
...
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/cherry/.ssh/identity
debug1: Trying private key: /home/cherry/.ssh/id_rsa
debug1: Trying private key: /home/cherry/.ssh/id_dsa
debug1: Next authentication method: password
cherry@59.151.47.49's password:
解决方案
就我所遇到的情况来看, 显然是要把 GSSAPI 禁用. 以下是三种可行的方式:
[注] 该解决方案是在客户端 OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 下测试并通过的.
1. 连接时用命令指定:
ssh -o GSSAPIAuthentication=no cherry@59.151.47.49
2. 在 ssh 客户端程序的配置文件里显式禁用 GSSAPI 认证. 如, 编辑 /etc/ssh/ssh_config 文件, 添加或修改使其有如下一行:
GSSAPIAuthentication no
3. 在用户根目录下的 .ssh 目录下创建一个 config 文件. 如, 编辑 /home/cherry/.ssh/config (如果该文件不存在, 则创建之), 添加选项:
GSSAPIAuthentication no
[注] A. /etc/ssh/ssh_config 是全局配置文件, 对其进行的修改会影响所有使用 ssh 客户端的系统用户.
B. /home/cherry/.ssh/config 是只会影响用户 xcl 的本地 ssh 客户端配置文件. 该文件的所有配置参数会覆盖全局配置文件的相同配置参数.
在禁用 GSSAPI 后, ssh 的登陆提示 "回归" 正常了:
cherry@cherry:~$ ssh -v cherry@59.151.47.49
...
...
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/cherry/.ssh/identity
debug1: Trying private key: /home/cherry/.ssh/id_rsa
debug1: Trying private key: /home/cherry/.ssh/id_dsa
debug1: Next authentication method: password
cherry@59.151.47.49's password:
可见, 该过程已经不再使用 GSSAPI 了. 速度也大大提高了.
就我自身所遇到的情况来看, 这些延迟绝大部分是 GSSAPI 的认证功能导致的!
你可以用 -v 选项确认你的情况. 例如, 下面是 ssh 的详细登陆过程:
cherry@cherry:~$ ssh -v cherry@59.151.47.49
...
...
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/cherry/.ssh/identity
debug1: Trying private key: /home/cherry/.ssh/id_rsa
debug1: Trying private key: /home/cherry/.ssh/id_dsa
debug1: Next authentication method: password
cherry@59.151.47.49's password:
解决方案
就我所遇到的情况来看, 显然是要把 GSSAPI 禁用. 以下是三种可行的方式:
[注] 该解决方案是在客户端 OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 下测试并通过的.
1. 连接时用命令指定:
ssh -o GSSAPIAuthentication=no cherry@59.151.47.49
2. 在 ssh 客户端程序的配置文件里显式禁用 GSSAPI 认证. 如, 编辑 /etc/ssh/ssh_config 文件, 添加或修改使其有如下一行:
GSSAPIAuthentication no
3. 在用户根目录下的 .ssh 目录下创建一个 config 文件. 如, 编辑 /home/cherry/.ssh/config (如果该文件不存在, 则创建之), 添加选项:
GSSAPIAuthentication no
[注] A. /etc/ssh/ssh_config 是全局配置文件, 对其进行的修改会影响所有使用 ssh 客户端的系统用户.
B. /home/cherry/.ssh/config 是只会影响用户 xcl 的本地 ssh 客户端配置文件. 该文件的所有配置参数会覆盖全局配置文件的相同配置参数.
在禁用 GSSAPI 后, ssh 的登陆提示 "回归" 正常了:
cherry@cherry:~$ ssh -v cherry@59.151.47.49
...
...
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/cherry/.ssh/identity
debug1: Trying private key: /home/cherry/.ssh/id_rsa
debug1: Trying private key: /home/cherry/.ssh/id_dsa
debug1: Next authentication method: password
cherry@59.151.47.49's password:
可见, 该过程已经不再使用 GSSAPI 了. 速度也大大提高了.
0 0
- ssh连接很慢GSS failure解决办法
- ssh连接慢解决办法
- ssh 连接很慢的解决办法
- ssh 连接很慢的解决办法
- ssh 连接很慢的解决办法
- SSH连接很慢的解决办法
- ssh连接 反应慢的解决办法
- centos ssh连接慢的解决办法
- ssh 连接过程很慢
- ubuntu下ssh连接远程主机特别慢的解决办法
- 关于ssh登陆很慢的解决办法
- ssh慢的解决办法
- linux ssh 慢解决办法
- ssh连接Linux很慢解决方案
- rh436 - ssh验证/连接很慢
- ssh连接的时候很慢问题解决
- linux ssh连接慢
- SSH连接慢问题解决
- 详解大端模式和小端模式
- HDU 1203 I NEED A OFFER!(01背包+概率)
- 【BZOJ3732】Network
- MongoDB分组group
- jsp 的页面 转换几个小问题response.sendRedirect
- ssh连接很慢GSS failure解决办法
- 数据结构与算法分析(c++版) #7 栈
- LEETCODE-Remove Linked List Elements
- Connection的方法介绍
- SPOJ NUMTRYE Number Theory (Easy) (pollard_rho分解质因数)
- org.apache.poi.ss.usermodel 类操作excel数据遗漏
- c++设计模式----解释器模式interpreter
- POJ 2886 线段树
- ListView乱谈之ListView的布局