knock(1)
π knock(1) β the port-knock client, bestie edition β¨
okay so you found the knock(1) man page and you're like "what is this" β don't worry, we're gonna get through it together π«Ά this is the manual for knock, and it's genuinely so much fun once it clicks.
πΈ NAME πΈ
knock β a port-knock client. that's the whole vibe. it knocks. on ports. iconic behavior tbh π
β¨ SYNOPSIS β¨
knock [options] <host> <port[:proto]> [port[:proto]] ...
so it's knock, then whatever options you want, then the host, then one or more ports β and each port can optionally have :proto stuck on the end if you're feeling fancy π
π¦ DESCRIPTION π¦
knock is a port-knock client, periodt. what it does is send TCP/UDP packets to each port you specify on host, and by doing that it creates a special knock sequence on the listening server. that's the whole trick β the server is listening for a specific little rhythm of knocks and you're out here performing it π
if you wanna know the server side of this whole situation, go read the knockd manpage β that's where the extra info lives π
π OPTIONS π
-u,--udpβ makes all your port hits use UDP instead of TCP (TCP is the default, fyi). but bestie, if you want each port to use a different protocol (some TCP, some UDP), you can just specify the protocol per-port instead. see the examples down below for how that looks β¨-d <t>,--delay <t>β waits <t> milliseconds between each port hit. why would you want this? because sometimes your router sees your stream of SYN packets and is like "omg is this a port scan???" and blocks them π but if you slow the packet rate down with--delay, then the router should let the packets through. crisis averted π-4,--ipv4 <version>β forces usage of IPv4 π§-6,--ipv6 <version>β forces usage of IPv6 π-v,--verboseβ outputs verbose status messages, so you actually get to see what's happening instead of vibing in the dark π₯-V,--versionβ displays the version. short and sweet π-h,--helpβ syntax help. your little safety net when you forget how anything works π
π EXAMPLES π
okay these are the moment, fr fr. first one β mixed protocols per port:
knock myserver.example.com 123:tcp 456:udp 789:tcp
see how each port gets its own :tcp or :udp? that's the per-port protocol thing from earlier. slay π¦
and then this one β all UDP, no per-port labels needed because of -u:
knock -u myserver.example.com 8284 4721 18592 42912
look at that lil sequence of port numbers just knocking away π so satisfying
π SEE ALSO π
knockd is the accompanying port-knock server β the other half of this whole relationship. you can't knock without somebody listening, iykyk π«Ά
π AUTHOR π
Judd Vinet <jvinet@zeroflux.org> β the icon who made this happen π
and that's the whole page, bestie!! this version of the knock page comes to you from knockd 0.8.2, dated June 26, 2005 β yeah it's an oldie but it still ate π
β¨ go knock on some ports, you've got this π
π¦ where this page comes from
- alpine 3.22: knock-doc 0.8.2-r2 Β· GPL-2.0-or-later
- alpine 3.23: knock-doc 0.8.2-r2 Β· GPL-2.0-or-later
- alpine 3.24: knock-doc 0.8.2-r2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms