SSH-PING(1) User Commands SSH-PING(1)

ssh-ping - check if host is reachable using ssh_config

Usage: ssh-ping [OPTIONS] [user@]hostname
OPTIONS:
-4
Use IPv4 only
-6
Use IPv6 only
Stop after sending <count> request packets
Connect as soon as the host responds and try reconnecting after a SSH session ends (e.g. rebooting). Useful also for IDRAC, IPMI, ILO devices, Switches, etc... which don't have a full shell environment. CTRL+C stops reconnect attempts.
Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file ( /etc/ssh/ssh_config ) will be ignored. The default for the per-user configuration file is ~/.ssh/config.
Show this message
Wait <interval> seconds between sending each request. The default is 1 second.
Try login with <user> as username. The default is $USER (builduser).
Print timestamp (unix time + microseconds as in gettimeofday) before each line
Print timestamp (human readable) before each line
Time to wait for a response, in seconds
Port to connect to on the remote host. This can be specified on a per-host basis in the configuration file.
Quiet output. Nothing is displayed except the summary lines at startup time and when finished
No colors. (e.g. for black on white terminals)
Verbose output
ENVIRONMENT_VARIABLES:
if set, no colors are shown (like -n)
SSH_PING_NO_COLORS=true ssh-ping -c 1 hostname
EXIT_CODES:
0
No requests lost
1
More than 1 request lost
2
All requests lost
ssh-ping -q -c 1 hostname >/dev/null || ...
February 2022 SSH-TOOLS