BuildTheNet

Opening your workspace

Your learning content and tools are loading.

SSH and Device Hardening

show ssh

Lists the SSH sessions currently connected to the device, with version, cipher, state and username.

Written by a working field network engineer · CCNA, Security+, CySA+

Lists the SSH sessions connected to the device right now, with the encryption negotiated and who is logged in.

Example output

R1#show ssh
Connection Version Mode Encryption  Hmac           State                 Username
0          2.0     IN   aes256-ctr  hmac-sha2-256  Session started       admin
0          2.0     OUT  aes256-ctr  hmac-sha2-256  Session started       admin
%No SSHv1 server connections running.

Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.

Useful variants

What each column or field means

FieldMeaning
ConnectionThe VTY session number.
VersionThe SSH protocol version negotiated.
ModeIN and OUT: each session is listed once per direction.
Encryption / HmacCipher and integrity algorithm negotiated with the client.
UsernameThe authenticated user.

When it doesn’t look right

New SSH logins fail while old ones are connected.

All VTY lines may be in use. Check show users and clear stale sessions with clear line vty <n>; add exec-timeout so idle sessions close.

Related commands

Try it yourself

Learn it in the CCNA path

Topic

SSH and Device Hardening — Replace Telnet with SSH: domain name, RSA keys, local users, VTY transport and login rules, and how to verify each one.

All 57 commands