---
name: "ssh-ping"
section: "1"
platform: "linux"
package: "ssh-tools"
version: "1.9-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ssh-ping"
---

# ssh-ping(1)

## NAME

ssh-ping

## SYNOPSIS

ssh-ping \[OPTIONS\] \[user@\]hostname

## DESCRIPTION

check if host is reachable using ssh\_config

## OPTIONS

- **-4**

  Use IPv4 only

- **-6**

  Use IPv6 only

- **-c** count

  Stop after sending \<count\> request packets

- **-C**

  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.

- **-E**

  Exit immediately after first successful ping\
   (can be used to trigger a follow up task like rsync)

- **-F** configfile

  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.

- **-h**

  Show this message

- **-i** interval

  Wait \<interval\> seconds between sending each request.\
   The default is 1 second.

- **-l** user

  Try login with \<user\> as username. The default is the current value of $USER.

- **-D**

  Print timestamp (unix time + microseconds as in gettimeofday) before each line

- **-H**

  Print timestamp (human readable) before each line

- **-W** timeout

  Time to wait for a response, in seconds

- **-p** port

  Port to connect to on the remote host.\
   This can be specified on a per-host basis in the configuration file.

- **-q**

  Quiet output.\
   Nothing is displayed except the summary lines at startup time and when finished

- **-n**

  No colors.\
   (e.g. for black on white terminals)

- **-v**

  Verbose output

- **--version**

  show version information

## TAB\_COMPLETIONS

Ubuntu (and maybe other distros) already ship\
 shell completions for ssh which can be used:

- **Bash**

  complete **-F** \_known\_hosts ssh-ping

- **Zsh**

  compdef \_ssh\_hosts ssh-ping

- **Fish**

  complete **-c** ssh-ping **-a** "(\_\_fish\_print\_hostnames)"

## ENVIRONMENT

- SSH\_PING\_NO\_COLORS

  if set, no colors are shown (like **-n**)

## EXIT\_CODES

- 0

  No requests lost

- 1

  More than 1 request lost

- 2

  All requests lost

## EXAMPLES

- ssh-ping **-E** hostname && echo "First successful ping. Starting rsync..."

  - ssh-ping **-q** **-c** 1 hostname \>/dev/null && echo "Host is up!"

  - ssh-ping **-q** **-c** 1 hostname \>/dev/null \|\| echo "Host is down!"

  - SSH\_PING\_NO\_COLORS=true ssh-ping **-c** 1 hostname
