knock(1)

knock1

Port-knock client

Usage

knock [options] <host> <port [:proto] > [port [:proto]] ...

Overview

knock is a port-knock client. It sends TCP/UDP packets to each specified port on host, creating a special knock sequence on the listening server (see the knockd manpage for more info on this).

Options

-u, --udp

Make all port hits use UDP (default is TCP). If you want each port to use a different protocol (TCP or UDP), then you can specify the protocol on a per-port basis. See the example below.

-d <t>, --delay <t>

Wait <t> milliseconds between each port hit. This can be used in situations where a router mistakes your stream of SYN packets as a port scan and blocks them. If the packet rate is slowed with --delay, then the router should let the packets through.

-4, --ipv4 <version>

Force usage of IPv4.

-6, --ipv6 <version>

Force usage of IPv6.

-v, --verbose

Output verbose status messages.

-V, --version

Display the version.

-h, --help

Syntax help.

Examples

knock myserver.example.com 123:tcp 456:udp 789:tcp
knock -u myserver.example.com 8284 4721 18592 42912

Releases

12 releases since Debian 3.1 (Sarge); the text changed 3 times.

  1. 3.1
  2. 4.0–8
  3. 9–11
  4. 12–Arch

--delay since Debian 9 (Stretch); --ipv4 since Debian 12 (Bookworm); --ipv6 since Debian 12 (Bookworm); -4 since Debian 12 (Bookworm); -6 since Debian 12 (Bookworm); -d since Debian 9 (Stretch).

Author

Judd Vinet <[email protected]>

From knockd 0.8-2 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.