.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. .TH SSH-PING "1" "May 2024" "SSH-TOOLS" "User Commands" .SH NAME ssh-ping \- check if host is reachable using ssh_config .SH DESCRIPTION .IP Usage: ssh\-ping [OPTIONS] [user@]hostname .IP OPTIONS: .TP \fB\-4\fR Use IPv4 only .TP \fB\-6\fR Use IPv6 only .TP \fB\-c\fR count Stop after sending request packets .TP \fB\-C\fR 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. .TP \fB\-E\fR Exit immediately after first successful ping (can be used to trigger a follow up task like rsync) .TP \fB\-F\fR configfile Specifies an alternative per\-user configuration file. If a configuration file is given on the command line, the system\-wide configuration file ( \fI\,/etc/ssh/ssh_config\/\fP ) will be ignored. The default for the per\-user configuration file is ~/.ssh/config. .TP \fB\-h\fR Show this message .TP \fB\-i\fR interval Wait seconds between sending each request. The default is 1 second. .TP \fB\-l\fR user Try login with as username. The default is the current value of $USER. .TP \fB\-D\fR Print timestamp (unix time + microseconds as in gettimeofday) before each line .TP \fB\-H\fR Print timestamp (human readable) before each line .TP \fB\-W\fR timeout Time to wait for a response, in seconds .TP \fB\-p\fR port Port to connect to on the remote host. This can be specified on a per\-host basis in the configuration file. .TP \fB\-q\fR Quiet output. Nothing is displayed except the summary lines at startup time and when finished .TP \fB\-n\fR No colors. (e.g. for black on white terminals) .TP \fB\-v\fR Verbose output .IP TAB_COMPLETIONS: .IP Ubuntu (and maybe other distros) already ship shell completions for ssh which can be used: .IP Bash : complete \fB\-F\fR _known_hosts ssh\-ping Zsh : compdef _ssh_hosts ssh\-ping Fish : complete \fB\-c\fR ssh\-ping \fB\-a\fR "(__fish_print_hostnames)" .IP ENVIRONMENT_VARIABLES: .TP SSH_PING_NO_COLORS if set, no colors are shown (like \fB\-n\fR) .TP Example: SSH_PING_NO_COLORS=true ssh\-ping \fB\-c\fR 1 hostname .IP EXIT_CODES: .TP 0 No requests lost .TP 1 More than 1 request lost .TP 2 All requests lost .TP Example: ssh\-ping \fB\-q\fR \fB\-c\fR 1 hostname >/dev/null && echo "Host is up!" ssh\-ping \fB\-q\fR \fB\-c\fR 1 hostname >/dev/null || echo "Host is down!" .TP EXAMPLES: ssh\-ping \fB\-E\fR hostname && echo "First successful ping. Starting rsync..."