The knowledge base / All cheat sheets
● Always in your toolkitAbout the project ↗

OpenSSH client connection investigation cheat sheet

Inspect OpenSSH client configuration, host keys and verbose connection stages without weakening host verification.

OpenSSH client on a workstation with authorized access to the target host.

Updated · OpenSSH · 6 min read

CommandWhat it does
ssh -VIdentify the client version
ssh -G server.example.comInspect effective client configuration
ssh-keygen -F server.example.comFind known-host entries
ssh -vvv admin@server.example.comInspect a connection attempt
ssh -o ConnectTimeout=10 admin@server.example.comAttempt a bounded connection

Walkthrough

Replace admin and server.example.com with your approved account and host. Connection attempts contact the server. Verify host-key fingerprints through a trusted independent channel before accepting any change.

Step 1: Identify the client version

ssh -V

Record the OpenSSH client version when investigating configuration or algorithm compatibility. A version alone does not establish which algorithms the server offers.

Step 2: Inspect effective client configuration

ssh -G server.example.com

Read the resolved host name, port, user and identity settings after client configuration is applied. This is a local configuration inspection; it does not connect or prove the destination is reachable.

Step 3: Find known-host entries

ssh-keygen -F server.example.com

Inspect existing known_hosts matches for the target. An entry or fingerprint mismatch requires verification through an independent trusted channel; do not automatically remove the existing key.

Step 4: Inspect a connection attempt

ssh -vvv admin@server.example.com

Review verbose connection, host-key and authentication stages to locate the failure. Logs can reveal usernames, network topology and key paths, so sanitize them before sharing.

Step 5: Attempt a bounded connection

ssh -o ConnectTimeout=10 admin@server.example.com

Use an authorized account and expected host name. ConnectTimeout limits connection establishment and the initial handshake, not necessarily every later interactive authentication step.

WORKED INCIDENT

Practical case: SSH fails after a server migration

Fictional teaching scenario; observations are examples, not captured production output.

Situation

An administrator sees a host-key warning when connecting to a recently migrated server.

Investigation sequence

1. Identify the client version

ssh -V

Record the client version and operating environment before comparing behavior.

2. Inspect effective client configuration

ssh -G server.example.com

Inspect the effective destination, port and user to ensure the intended host is selected.

3. Find known-host entries

ssh-keygen -F server.example.com

Find the existing known-host entry and compare its fingerprint with trusted inventory.

4. Inspect a connection attempt

ssh -vvv admin@server.example.com

If appropriate, capture the connection stage without accepting an unverified replacement key.

Example findings

Illustrative findings: the resolved destination is correct, but its presented host key differs from the previously recorded key.

Interpret the findings

A mismatch may be legitimate after migration or indicate an unexpected endpoint. The warning alone cannot distinguish those cases; confirm the new fingerprint out of band.

Verify the outcome

After the administrator verifies and updates host-key trust using the approved process, reconnect with verification enabled and confirm the intended server identity.

Escalation handoff

Provide the hostname, resolved address and independently verified fingerprints to the server owner; do not share private keys.

Primary references

Documented reference; examples above are teaching scenarios. Confirm behavior against your deployed version.