我在用着OpenSSH_5.8p1在我的机器中,我使用 putty 客户端连接我的机器,但速度较慢,因此我在调试模式下运行 sshd 并发现以下消息,有人可以详细解释每条消息吗?
debug1: sshd version OpenSSH_5.8p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: read PEM private key done: type ECDSA
debug1: private host key: #2 type 3 ECDSA
debug1: rexec_argv[0]='/sbin/sshd'
debug1: rexec_argv[1]='-d'
Set /proc/self/oom_adj from 0 to -17
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 6 out 6 newsock 6 pipe -1 sock 9
debug1: inetd sockets after dupping: 4, 4
Connection from 192.168.0.57 port 33962
debug1: Client protocol version 2.0; client software version PuTTY_Release_0.63
debug1: no match: PuTTY_Release_0.63
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8
debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server aes256-ctr hmac-sha1 none
debug1: kex: server->client aes256-ctr hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
delay of 1.5 second
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
delay of 1.8 second
debug1: KEX done
Connection closed by 192.168.0.57
答案1
这个问题听起来像是一个案例XY问题;你所要求的东西可能无法帮助你解决你的问题实际上想要解决。也许你应该更加小心你的要求,但为了一般知识,这里是......
debug1: sshd version OpenSSH_5.8p1
这表明OpenSSH的版本是5.8p1
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: read PEM private key done: type ECDSA
debug1: private host key: #2 type 3 ECDSA
这表明 OpenSSH 找到了三个主机密钥,这些密钥用于让客户端相信远程确实是客户端想要连接的主机。按键用于RSA,DSA和椭圆曲线 DSA密码算法。
debug1: rexec_argv[0]='/sbin/sshd'
debug1: rexec_argv[1]='-d'
这些是调用 ssh 守护进程所使用的参数。
Set /proc/self/oom_adj from 0 to -17
这表明 ssh 守护进程禁用了内核内存不足杀手完全为了这个过程。
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
这表明服务器正在侦听从任何 IPv4 源地址到端口 22 的连接。
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
这表明服务器正在侦听从任何 IPv6 源地址到端口 22 的连接。
debug1: Server will not fork when running in debugging mode.
通常 sshd 会为每个传入连接创建一个新进程。由于这些-d
选项是在调用 sshd 时指定的,因此它以调试模式运行并且不会分叉,并且只会处理一个连接。
debug1: rexec start in 6 out 6 newsock 6 pipe -1 sock 9
debug1: inetd sockets after dupping: 4, 4
这表明某些通信套接字是重复的。
Connection from 192.168.0.57 port 33962
debug1: Client protocol version 2.0; client software version PuTTY_Release_0.63
debug1: no match: PuTTY_Release_0.63
debug1: Enabling compatibility mode for protocol 2.0
这表示已从 Putty 客户端收到传入连接。 ssh 守护进程无法识别客户端发送的特定版本字符串,因此它将以与SSH 协议版本 2规格。
debug1: Local version string SSH-2.0-OpenSSH_5.8
debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
这表明 ssh 守护进程将自己标识为 SSH 2.0 兼容的 OpenSSH 守护进程。主机密钥类型指示 ssh 守护程序支持执行主机身份验证的加密算法。
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server aes256-ctr hmac-sha1 none
debug1: kex: server->client aes256-ctr hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
delay of 1.5 second
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
delay of 1.8 second
debug1: KEX done
这些消息表明迪菲-赫尔曼 团体交流执行以交换密钥材料。协议完成后,客户端和服务器就使用会话密钥来加密进一步的通信达成了一致。AES具有 256 位密钥的加密算法计数器模式和SHA1 加密哈希算法为了基于哈希的消息认证码。
Connection closed by 192.168.0.57
这表明连接已被客户端关闭。