I downloaded a port knocking script from http://www.zeroflux.org/projects/knock

It downloaded a file knock, which is a Unix Executable File. When I double click on it, it runs the Terminal, where it writes

Last login: Thu Nov  1 12:19:53 on ttys003
Admins-MacBook-Air-3:~ me$ /Users/me/Desktop/knock ; exit;
usage: knock [options] <host> <port[:proto]> [port[:proto]] ...
  -u, --udp            make all ports hits use UDP (default is TCP)
  -v, --verbose        be verbose
  -V, --version        display version
  -h, --help           this help

example:  knock myserver.example.com 123:tcp 456:udp 789:tcp


[Process completed]

But I would like to run it in Terminal using knock [options]. How do I do that?

  • So you want to run knockd locally to allow remote access to your MBA?
    – nohillside
    Commented Nov 1, 2012 at 13:04
  • And there is neither a knockd nor a knock --daemon for OSX in the downloaded package, it's only the client.
    – nohillside
    Commented Nov 1, 2012 at 13:23
  • yes, i wanted only the client Commented Nov 5, 2012 at 17:27

1 Answer 1


First of all, I assume we're referring to the executable downloaded at http://www.zeroflux.org/proj/knock/files/knock-macos.tar.gz.

Most command-line executables like knock aren't designed to be double-clicked on in the Finder. Doing so simply executes the executable with no options, so this isn't what you want.

Instead, open a new Terminal window (using Spotlight or in the Finder from /Applications/Utilities/) and type in something like the following and press return:

/Users/me/Desktop/knock --version

Doing that should print out:

knock 0.5
Copyright (C) 2004-2005 Judd Vinet <[email protected]>

Basically, when you type that stuff into the Terminal prompt, the Terminal executes /Users/me/Desktop/knock and passes it the --version option.

If you were to type in only the following and press return, you'd get the same "unwanted" output as before:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .