通过如下步骤获得当前SSH会话一些有用的统计信息(该步骤仅对SSH2客户端有效).
1. 从本地主机登录远程主机
localhost$ ssh -l jsmith remotehost
2. 在远程主机上输入转义符 ~ 和 s . 将会显示许多关于当前连接SSH的有用的统计信息.
remotehost$ [注释: 当你输入~s 命令时, 该命令并没有显示在屏幕上.]
remote host: remotehost
local host: localhost
remote version: SSH-1.99-OpenSSH_3.9p1
local version: SSH-2.0-3.2.9.1 SSH Secure Shell (non-commercial)
compressed bytes in: 1506
uncompressed bytes in: 1622
compressed bytes out: 4997
uncompressed bytes out: 5118
packets in: 15
packets out: 24
rekeys: 0
Algorithms:
Chosen key exchange algorithm: diffie-hellman-group1-sha1
Chosen host key algorithm: ssh-dss
Common host key algorithms: ssh-dss,ssh-rsa
Algorithms client to server:
Cipher: aes128-cbc
MAC: hmac-sha1
Compression: zlib
Algorithms server to client:
Cipher: aes128-cbc
MAC: hmac-sha1
Compression: zlib
localhost$
更多SSH信息
配置基于SSH密钥的身份验证, 请参考openSSH和SSH2的教程.