Use it to connect to servers, or when the client cannot connect or authenticate.
SSH Client
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.
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.
client reads config → TCP connect → host key check → key/password authentication → session
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
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 · 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.
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.
ssh -v user@host— client-side connection and authentication stepsjournalctl -u ssh -u sshd -e— server logsshd -T— effective server settingsss -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:
| Option | Purpose |
|---|---|
-p <port> | Remote port |
-i <file> | Identity (private key) file |
-J <jump> | Connect through one or more jump hosts (ProxyJump) |
-L / -R / -D | Local, remote or dynamic (SOCKS) forwarding |
-N | No remote command (forwarding only) |
-f | Go to the background before running the command |
-W host:port | Forward stdin/stdout to a host and port |
-o Key=Value | Any ssh_config option on the command line |
-v, -vv, -vvv | Debug output, up to three levels |
-A, -X | Agent 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:
| Escape | Effect |
|---|---|
~. | Disconnect, even from a hung session |
~? | List the escapes |
~C | Open 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.
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.
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
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%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.
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.
Quick lookup tables
SSH Client operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for SSH Client.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | 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. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin 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 chain | client invocation → host pattern/effective config → resolution/proxy path → TCP connect → KEX/host verification → identity selection/authentication → channel request → remote outcome | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | 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. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated 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 outcome | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It 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 check | Continue 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 boundary | SSH Client |
|---|---|
| Topic path | SSH → SSH Client |
| Runtime state | 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. |
| 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 chain | client 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 boundary | 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. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |