密码后 ssh 登录延迟

密码后 ssh 登录延迟

发出 ssh 命令后,我立即收到密码提示。但输入密码后,我至少要延迟 15 到 20 秒才能看到 shell 提示。以下是我的服务器信息:

inblr-mvm-3468:~ # cat /etc/os-release 
NAME="SAIL"
VERSION="7.5.0"
VERSION_ID="7.5.0.11"
PRETTY_NAME="X SAIL 7.5.0.11"
ID="sail"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:X:sail:7.5.0.11"
inblr-mvm-3468:~ # uname -a
Linux inblr-mvm-3468 4.12.14-122.63.1.uis.125.02-default #1 SMP Thu Apr 1 19:06:20 UTC 2021 () x86_64 x86_64 x86_64 GNU/Linux
inblr-mvm-3468:~ # 

以下是 ssh 详细输出:

C:\Users\srinivag>ssh -v [email protected]
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data C:\\Users\\srinivag/.ssh/config
debug1: C:\\Users\\srinivag/.ssh/config line 2: Applying options for 10.221.96.139
debug1: Connecting to 10.221.96.139 [10.221.96.139] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\srinivag/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_dsa-cert type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_ecdsa type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_ed25519 type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_ed25519-cert type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_xmss type -1
debug1: identity file C:\\Users\\srinivag/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2
debug1: match: OpenSSH_7.2 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to 10.221.96.139:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:FJVnD8A54nml7jRApl7JBpANPN0JDWhOMNDP6xAMzcA
debug1: Host '10.221.96.139' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\srinivag/.ssh/known_hosts:9
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:\\Users\\srinivag/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\srinivag/.ssh/id_dsa
debug1: Will attempt key: C:\\Users\\srinivag/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\srinivag/.ssh/id_ed25519
debug1: Will attempt key: C:\\Users\\srinivag/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\srinivag/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\srinivag/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\srinivag/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\srinivag/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\srinivag/.ssh/id_xmss
debug1: Next authentication method: keyboard-interactive
debug1: read_passphrase: can't open /dev/tty: No such file or directory
Password:
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to 10.221.96.139 ([10.221.96.139]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: ENABLE_VIRTUAL_TERMINAL_INPUT is supported. Reading the VTSequence from console
**debug1: ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported. Console supports the ansi parsing**
debug1: client_input_global_request: rtype [email protected] want_reply 0
Last login: Mon Jul  4 06:32:12 2022 from 10.125.236.210
inblr-mvm-3468:~ #

延迟发生在以下行之后:

debug1: ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported. Console supports the ansi parsing

我尝试取消注释行UseDNS no/etc/ssh/sshd_config但没有成功。

答案1

查看您的 DNS 配置。检查 SSH 服务器是否能够解析连接系统。

相关内容