Wednesday, 31 May 2017

How to SSH Session Statistics using SSH Escape Character in Linux

To get some useful statistics about the current ssh session, do the following.

This works only on SSH2 client.
1. Login to remotehost from localhost.
localhost$ ssh -l jsmith remotehost

2. On the remotehost, type ssh escape character ~ followed by s as shown
below. This will display lot of useful statistics about the current SSH
connection.
remotehost$ [Note: The ~s is not visible on the
command line when you type.]
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$
Additional SSH Info
On a side note, to setup SSH key based authentication, refer openSSH and
SSH2 tutorials.

No comments:

Post a Comment

What is PS2 - Continuation Interactive Prompt in Linux

A very long command can be broken down to multiple lines by giving \ at the end of the line. The default interactive prompt for a multi-lin...