Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

SSH Client

Direct answer

The SSH client (ssh) connects to a server, verifies its host key against known_hosts, authenticates you and runs a shell or command. It reads ~/.ssh/config for per-host settings.

When to use this

Use it to connect to servers, or when the client cannot connect or authenticate.

First 30 seconds

1. ssh -v user@host — connected? Which keys offered?

2. Timeout → network/firewall; refused → sshd not listening.

3. Host key changed warning → verify the new key before accepting.

4. Key not accepted → right key offered? -i <key> -o IdentitiesOnly=yes.

5. Save settings in ~/.ssh/config.

Operational verification

client reads config → TCP connect → host key check → key/password authentication → session

Evidence · next step

For SSH → SSH Client, continue with the first unproven Topic check: Capture exact command, destination alias, user, port and requested channel type. If that boundary is healthy, advance to the adjacent check: Inspect effective client configuration for the destination and compare with intended settings. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to connect to servers, or when the client cannot connect or authenticate.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

client invocation → host pattern/effective config → resolution/proxy path → TCP connect → KEX/host verification → identity selection/authentication → channel request → remote outcome

Healthy evidence: the intended destination and identity are selected, server host identity validates, compatible algorithms negotiate, authentication succeeds and the requested remote channel completes.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Capture exact command, destination alias, user, port and requested channel type.

  • Inspect effective client configuration for the destination and compare with intended settings.
  • Use bounded verbosity to identify the first failed negotiation/auth/session boundary.
  • Retest the original operation rather than only a generic interactive login.

Verification chain. client invocation → host pattern/effective config → resolution/proxy path → TCP connect → KEX/host verification → identity selection/authentication → channel request → remote outcome

Step 3 Commands Verify boundary
ssh -i ~/.ssh/id_ed25519 user@host
ssh -J jump user@internal
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: an unexpected Host stanza overrides settings, wrong identity or proxy is selected, cached host identity conflicts, or client negotiation succeeds before a server-side session denial.

Step 5 Common mistakes Narrow the fault
  • Using passwords where keys and agents are possible.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Use ssh -v (or -vvv) to see each step. Use -i or IdentityFile for a specific key and ssh-agent to avoid retyping passphrases. Too many keys in the agent can exceed MaxAuthTries — set IdentitiesOnly yes.

Key checks
  • ssh -v user@host — client-side connection and authentication steps
  • journalctl -u ssh -u sshd -e — server log
  • sshd -T — effective server settings
  • ss -ltnp | grep :22 — sshd listening
ReferenceWhat it is1 section · depth on demand

Core model

Start from the exact invocation and use the client effective-configuration view/verbose trace to see Host matching, hostname, port, user, proxy/jump behavior, identities and algorithm policy. Separate local config selection from network transport, host-key verification, authentication and remote session behavior.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Client-side configuration and verbose traces show what the client attempted and observed; they do not show server-side policy, remote filesystem permissions or downstream application health.

In depth

Everyday ssh client usage

The ssh client does far more than interactive logins. The ssh(1) manual page documents the main options:

OptionPurpose
-p <port>Remote port
-i <file>Identity (private key) file
-J <jump>Connect through one or more jump hosts (ProxyJump)
-L / -R / -DLocal, remote or dynamic (SOCKS) forwarding
-NNo remote command (forwarding only)
-fGo to the background before running the command
-W host:portForward stdin/stdout to a host and port
-o Key=ValueAny ssh_config option on the command line
-v, -vv, -vvvDebug output, up to three levels
-A, -XAgent and X11 forwarding (the manual advises caution)

Escape sequences

The escapes only work at the start of a line in a session with a terminal:

EscapeEffect
~.Disconnect, even from a hung session
~?List the escapes
~COpen a command line to add or cancel port forwardings
~#List forwarded connections

Authentication order and exit status

The client tries GSSAPI, host-based, public key, keyboard-interactive and password, in that order, unless PreferredAuthentications changes it. The exit status is the remote command's status, or 255 if ssh itself failed. Scripts can tell "the command failed" apart from "the connection failed" by checking for 255.

admin$ ssh -J bastion.example.net admin@10.30.0.11
admin$ ssh srv1 'systemctl is-active nginx'; echo "exit=$?"
active
exit=0
admin$ ssh -o ConnectTimeout=5 srv9 true; echo "exit=$?"
ssh: connect to host srv9 port 22: Connection timed out
exit=255
admin$ ssh srv1 -t 'sudo journalctl -fu nginx'
admin$ echo $SSH_CONNECTION
10.110.0.64 51234 10.30.0.11 22

SSH_CONNECTION

On the server, SSH_CONNECTION holds the client IP, client port, server IP and server port. It's useful in scripts and prompts to show where a session came from.

-t forces a terminal for commands that need one, such as sudo prompts or journalctl -f. Without it, interactive programs run over plain pipes and may behave strangely.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

SSH Client is part of SSH → SSH Client. The OpenSSH client resolves destination and configuration, selects identity/authentication methods, verifies server host identity, negotiates transport and requests channels such as shell, exec, subsystem or forwarding.

Runtime state ownership and mechanics. OpenSSH connection setup crosses TCP reachability, server process/listener, algorithm negotiation, host-key verification, user authentication, account/PAM policy, authorization and session/subsystem creation.

Topic-specific state model. The OpenSSH client resolves destination and configuration, selects identity/authentication methods, verifies server host identity, negotiates transport and requests channels such as shell, exec, subsystem or forwarding.

Technical metadata. Client host/distribution/OpenSSH version, server host/distribution/OpenSSH version, timestamp, destination name/address/port, source address, username, ssh_config Host/Match/Include resolution, proxy/jump path, negotiated KEX/host-key/cipher/MAC where relevant, server host-key fingerprint, known_hosts source, authentication method, client identity fingerprint/agent source, authorized-key source/options, sshd_config Include/Match/effective policy, PAM/account result, session type, PTY/command/subsystem, local/remote/dynamic forward endpoints, server PID/unit/listener, remote process/exit status, source/destination file path and hash where relevant, client/server logs and original workload result.

Interpretation rule. - Typed hostname ≠ final destination after HostName/ProxyJump/ProxyCommand processing.

  • Identity file configured ≠ key offered, accepted or usable by its agent/passphrase context.
  • Host key matched ≠ user authentication succeeded.
  • Client exit code 0 for one command ≠ another SSH channel type will succeed.

Quick reference

SSH client usage:

ssh -i ~/.ssh/id_ed25519 -p 2222 alice@web01
ssh -J bastion.example.com alice@10.0.30.15       # jump host
ssh -o StrictHostKeyChecking=accept-new web01      # first connection in automation
ssh web01 'sudo systemctl is-active nginx'
ssh -t web01 'sudo -i'                             # allocate TTY
ssh -o ConnectTimeout=5 -o BatchMode=yes web01 true && echo ok

BatchMode=yes makes scripts fail instead of hanging on password prompts. Agent forwarding (-A) exposes your agent to the remote root — prefer -J ProxyJump.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Client-side configuration and verbose traces show what the client attempted and observed; they do not show server-side policy, remote filesystem permissions or downstream application health.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. SSH Client owns local OpenSSH client behavior and effective per-host configuration. ssh_config owns configuration semantics; known_hosts owns server trust data; server-side policy belongs to SSH Server/sshd/sshd_config.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in SSH → SSH Client. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.openssh.com/manual.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
ssh clientopenssh clientssh verbosessh effective config
Embedded reference data

Quick lookup tables

SSH Client operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for SSH Client.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateThe OpenSSH client resolves destination and configuration, selects identity/authentication methods, verifies server host identity, negotiates transport and requests channels such as shell, exec, subsystem or forwarding.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact client/server + attempt time → resolve destination/TCP path → inspect effective client config → identify OpenSSH versions → verify KEX + host-key trust → trace offered/accepted authentication → inspect effective sshd policy for user/source → verify session/subsystem/forward → verify remote process/filesystem/service → repeat original workload.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainclient invocation → host pattern/effective config → resolution/proxy path → TCP connect → KEX/host verification → identity selection/authentication → channel request → remote outcomeTrace requested/configured state through effective state to the observed workload result.
Failure boundaryClient-side configuration and verbose traces prove what the client attempted and observed; they do not independently prove server-side policy, remote filesystem permissions or downstream application health.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux SSH evidence can establish this proof path: client invocation → host pattern/effective config → resolution/proxy path → TCP connect → KEX/host verification → identity selection/authentication → channel request → remote outcomeUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured transport, trust, authentication, policy, session, filesystem or workload scope. Client-side configuration and verbose traces prove what the client attempted and observed; they do not independently prove server-side policy, remote filesystem permissions or downstream application health.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: correlate client and server evidence for the same attempt, inspect effective client/server configuration and identity/trust/authentication state, then test the exact requested session, transfer or forward before changing additional layers.Continue to the next unresolved boundary while preserving the original test condition.

SSH Client · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundarySSH Client
Topic pathSSH → SSH Client
Runtime stateThe OpenSSH client resolves destination and configuration, selects identity/authentication methods, verifies server host identity, negotiates transport and requests channels such as shell, exec, subsystem or forwarding.
Fast checks- Capture exact command, destination alias, user, port and requested channel type. - Inspect effective client configuration for the destination and compare with intended settings. - Use bounded verbosity to identify the first failed negotiation/auth/session boundary. - Retest the original operation rather than only a generic interactive login.
Verification chainclient invocation → host pattern/effective config → resolution/proxy path → TCP connect → KEX/host verification → identity selection/authentication → channel request → remote outcome Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryClient-side configuration and verbose traces prove what the client attempted and observed; they do not independently prove server-side policy, remote filesystem permissions or downstream application health. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?