Print effective SSH client settings for a host
Build a paste-ready command, then review its compatibility and effects before running it.
ssh -G <host> | rg '^(hostname|user|port|identityfile|proxyjump) 'Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementssshssh must be installed and available on PATH.
Version supportssh Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalshost example.comRepresentative 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 -G {{host}} | rg '^(hostname|user|port|identityfile|proxyjump) 'The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01sshCommandRuns the ssh stage of this one-liner.
02-GOptionPrints the fully evaluated client configuration and exits without connecting.
03<host>ParameterA value supplied in the Fill parameters section.
04|PipelinePasses the output on the left to the command on the right.
05rgCommandRuns the rg stage of this one-liner.
06'^(hostname|user|port|identityfile|proxyjump) 'ArgumentPasses '^(hostname|user|port|identityfile|proxyjump) ' to rg.
Example input
ssh -G example.com | rg '^(hostname|user|port|identityfile|proxyjump) '
Example output
host example.com
user alex
hostname example.com
port 22
identityfile ~/.ssh/id_ed25519
proxyjump none
Illustrative output — exact values vary by system and data.
Official sources