Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an OpenWrt router where I installed knockd:

    logfile = /var/log/knockd.log

    sequence    = 7000,8000,9000
    seq_timeout = 5
    command     = /usr/sbin/iptables -I INPUT -s %IP% -p tcp --dport 22 -j ACCEPT
    tcpflags    = syn

    sequence    = 9000,8000,7000
    seq_timeout = 5
    command     = /usr/sbin/iptables -D INPUT -s %IP% -p tcp --dport 22 -j ACCEPT
    tcpflags    = syn

and I'm having a notebook with Scientific Linux 6.1 from where I want to knock.. but seems there isn't any "knock" package for SL 6.1..

Where can I get the RPM for the knock binary? (Or are there any alternatives for knock? A perl script maybe?)

share|improve this question
Security by obscurity :D – Jiri Xichtkniha Jun 17 '12 at 21:25
@JiriXichtkniha, well, it's extra-security measure, so why not. ;-) – poige Jun 19 '12 at 3:30
So you trust more some perl script based portknocking than openssh which is developted by OpenBSD guys with security in mind? :D Is not great portknocking l33t tool running under root? LOL. – Jiri Xichtkniha Jun 19 '12 at 9:02
up vote 2 down vote accepted

This can be done with either bash's /dev/tcp/host/port or netcat.

share|improve this answer
IPA=; nc -z -w 1 $IPA 7000; nc -z -w 1 $IPA 8000; nc -z -w 1 $IPA 9000 – gasko peter Jun 20 '12 at 11:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.