Skip to content

Friday, December 4th, 2009

New Linux User

Geeky Fun: Knockd

July 6, 2006 by Jon  
Filed under Geeky Fun

I ran across this crazy application yesterday named knockd. Knockd is a daemon that listens for a specified series of ‘knocks’ on specified ports and then performs a specified action. Do I win an award for using the word ’specified’ three times in one sentence?

This may not be a new Linux user topic per se, but it has so much potential that I wanted to make sure I mentioned it.

In this example, Marius uses knockd to modify his iptables when he pings ports 7000, 8000, and 9000 in sequence. The modification involves adding the IP address that the pings came from to allow that IP to SSH into the system. When he’s done, he pings the ports in reverse order and knockd then removes that IP’s access. This allows him to keep his box secure by not allowing anyone except a single internal IP to SSH in except for the brief period of time when he uses knockd to change that. Bloody brilliant.

I’ve not used knockd yet although I’m really racking my brains to come up with a good excuse to try it out.

  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • Reddit
  • Yahoo! Buzz
  • Slashdot
  • E-mail this story to a friend!

Comments

One Response to “Geeky Fun: Knockd”
  1. Syd says:

    Another way to do it is to open the port, specify a short timeout (probably 10-60 seconds), and then automatically close the port (using start_command, cmd_timeout, and stop_command instead of just command).

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


About Us | Advertise with us | Blog for EveryJoe | Privacy Policy | Terms of Use
Get This Theme | Sitemap


All content is Copyright © 2005-2009 b5media. All rights reserved.