Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an OpenWrt router where I installed knockd:

knockd.conf 
[options]
    logfile = /var/log/knockd.log

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

[closeSSH]
    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
add comment

1 Answer

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=192.168.1.1; 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
add comment

Your Answer

 
discard

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.