SSH登录延迟-找不到凭据缓存

奇普·谢德(Chip Shadd)

我有一个跳转框,其中到其他服务器的SSH登录已开始经历严重的延迟(超过20秒以上)。此问题从此跳转框显示到任何目标,从不同来源登录到同一目标不会出现相同的延迟。

以下是SSH客户端的详细输出,调试输出中的延迟始终为debug1: Miscellaneous failure

# ssh -vvv x.x.x.x
OpenSSH_5.9p1 (CentrifyDC build 4.5.3-557) (CentrifyDC build 4.5.3-557),OpenSSL 0.9.8k (CentrifyDC build 4.5.3-557) 25 Mar 2009
debug1: Reading configuration data /root/.ssh/config
debug1: /root/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/centrifydc/ssh/ssh_config
debug1: /etc/centrifydc/ssh/ssh_config line 52: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to x.x.x.x [x.x.x.x] port 22.
debug1: Connection established.
debug3: permantently_set_uid getpwnam(root)
debug3: getpwnam returned 0, uid = 0 
debug1: permanently_set_uid: 0/0
debug3: Incorrect RSA1 identifier
debug3: Could not load "/root/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug2: fd 3 setting O_NONBLOCK
#######DELAY#######
debug1: Miscellaneous failure
No credentials cache found

#######DELAY#######
debug1: Miscellaneous failure
No credentials cache found

debug3: load_hostkeys: loading entries for host "x.x.x.x" from file "/root/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /root/.ssh/known_hosts:36
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-group14-sha1-toWM5Slw5Ew8Mqkay+al2g==,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 47:4f:f2:cb:0a:f3:47:f7:77:a4:12:d6:a8:81:21:d8
debug3: load_hostkeys: loading entries for host "x.x.x.x" from file "/root/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /root/.ssh/known_hosts:36
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'x.x.x.x' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:36
debug1: ssh_ecdsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /root/.ssh/id_rsa (0x959db0)
debug3: input_userauth_banner
S
Kernel 3.10.0-327.10.1.el7.x86_64 on an x86_64

debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-keyex
debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-keyex
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug2: we did not send a packet, disable method
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
#######DELAY#######
debug1: Miscellaneous failure
No credentials cache found

#######DELAY#######
debug1: Miscellaneous failure
No credentials cache found

debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp 89:18:67:ee:6a:09:90:f4:9a:9e:3f:1e:b3:1f:dc:41
debug3: sign_and_send_pubkey: RSA 89:18:67:ee:6a:09:90:f4:9a:9e:3f:1e:b3:1f:dc:41
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to x.x.x.x ([x.x.x.x]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug2: callback start
debug2: client_session2_setup: id 0
debug2: fd 3 setting TCP_NODELAY
debug2: channel 0: request pty-req confirm 1
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Thu Nov  9 02:30:14 2017 from y.y.y.y
[[email protected] ~]# 
用户名

错误消息来自Kerberos身份验证机制,尽管我只能猜测延迟的确切原因。

  • 您的客户端和服务器都支持通过GSSAPI进行Kerberos身份验证。

    您实际上没有Kerberos凭证(kinit),但是客户端并不真正知道,只有GSSAPI机制(Kerberos)知道。因此,只要启用了GSSAPI,客户端都会尝试使用它。

  • 传统上,客户端上的Kerberos依靠反向DNS来确定服务器的完整域名。有时,用于内部IP地址的rDNS不会以简单的方式返回成功或失败的方式来破坏;它根本不会返回响应,并且客户端被迫等待整个查询超时。(例如,ISP或公司的DNS服务器可能具有“保护”功能,它们会完全阻止答复。)

    Kerberos可能需要知道域名才能找到正确的凭据,因此Kerberos甚至在查看是否具有凭据缓存之前都将执行rDNS检查

建议:

  1. 运行time host x.x.x.x(其中xxxx是服务器的IP地址)并检查DNS解析需要多长时间。即时失败是可以的;长时间的延迟不是。

  2. 通过命令行或ssh_config(5)将SSH客户端中GSSAPIAuthenticationGSSAPIKeyExchange选项设置为“ off” ,以暂时禁用Kerberos。

  3. 如果您知道您的网络不支持Kerberos,请在SSH服务器配置中禁用相同的选项,以完全跳过该过程。

    (没有必要在两侧禁用它。如果服务器不提供它,客户端将不会费心尝试。)

尽管由于您实际上已经安装了Centrify SSH而不是通常的OpenSSH,但我猜您确实有一个有效的Kerberos设置(或者至少在某个时候安装了它),而不是禁用它,而是寻求对其进行修复好一点。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

使用PayPal(PHP)登录->“找不到默认用户的凭据”。

来自分类Dev

在Android上执行“一键登录”和注册时,获取“ 16:找不到匹配的凭据”

来自分类Dev

是否存储SSH登录凭据?

来自分类Dev

是否存储SSH登录凭据?

来自分类Dev

雾谷歌找不到凭据

来自分类Dev

找不到ssh localhost命令

来自分类Dev

远程 SSH 找不到代理

来自分类Dev

延迟符号绑定失败:找不到符号

来自分类Dev

找不到类“缓存”-Prestashop

来自分类Dev

找不到CacheableOperation []缓存中名为“”的缓存

来自分类Dev

ssh登录过程中的长时间延迟

来自分类Dev

SSH登录不被接受,并且ssh登录尝试之间没有延迟

来自分类Dev

找不到真棒DE登录图标

来自分类Dev

PHP和SQL登录-“找不到用户”

来自分类Dev

在“ Microsoft登录”页面上找不到元素

来自分类Dev

在Dropbox登录窗口中找不到图像

来自分类Dev

找不到登录页面和哈希页面

来自分类Dev

Java找不到登录处理URL

来自分类Dev

找不到真棒DE登录图标

来自分类Dev

登录后在tty中的“♦:找不到命令”

来自分类Dev

找不到android facebook登录网页

来自分类Dev

Laravel [登录消息]找不到异常

来自分类Dev

sudo:ruby:ssh之后找不到命令

来自分类Dev

ssh错误bash:22:找不到命令

来自分类Dev

在终端中找不到ssh命令

来自分类Dev

Chroot SSH-找不到命令

来自分类Dev

-bash:yum:通过SSH找不到命令

来自分类Dev

通过SSH时找不到命令

来自分类Dev

针对iOS上的Azure Graph API的非交互式登录(缓存的凭据)