Diagnose an SSH connection without opening an interactive shell
Build a paste-ready command, then review its compatibility and effects before running it.
ssh -vvv -o BatchMode=yes -o ConnectTimeout=10 <username>@<host> trueComplete required fields to copy the generated command.
Compatibility
Non-interactive probeBatchMode prevents password prompts, while the remote true command exits without modifying remote state.
Operational knowledgereview due 2027-01-19
Requirementssshssh must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportssh Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsdebug1: Connecting to app01.example.com [203.0.113.25] port 22.Representative successful output; values vary with the selected target and system state.
Known errorsssh: command not foundssh is missing or is not available on PATH.
Verifyssh -vvv -o BatchMode=yes -o ConnectTimeout=10 {{user}}@{{host}} trueRe-run the corresponding read-only inspection and confirm the intended state.Rollback noteNo universal automatic rollback is available. Capture the current state and use the tool-specific recovery procedure before applying changes.
Command breakdown
01sshCommandRuns the ssh stage of this one-liner.
02-vvvOptionEnables the most detailed OpenSSH client diagnostic output.
03-oOptionSets the following OpenSSH client configuration option.
04BatchMode=yesArgumentPasses BatchMode=yes to ssh.
05-oOptionSets the following OpenSSH client configuration option.
06ConnectTimeout=10ArgumentPasses ConnectTimeout=10 to ssh.
07<username>@ParameterA value supplied in the Fill parameters section.
08<host>ParameterA value supplied in the Fill parameters section.
09trueArgumentPasses true to ssh.
Example input
ssh -vvv -o BatchMode=yes -o ConnectTimeout=10 deploy@app01.example.com true
Example output
debug1: Connecting to app01.example.com [203.0.113.25] port 22.
debug1: Server host key: ssh-ed25519 SHA256:3m…Q
debug1: Authentication succeeded (publickey).
debug1: Exit status 0
Illustrative output — exact values vary by system and data.
Official sources
Related commands