Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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]] ...
options:
  -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

logout

[Process completed]

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

share|improve this question
    
So you want to run knockd locally to allow remote access to your MBA? –  patrix Nov 1 '12 at 13:04
    
And there is neither a knockd nor a knock --daemon for OSX in the downloaded package, it's only the client. –  patrix Nov 1 '12 at 13:23
    
yes, i wanted only the client –  Peter Lapisu Nov 5 '12 at 17:27
add comment

1 Answer 1

up vote 4 down vote accepted

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 <jvinet@zeroflux.org>

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:

/Users/me/Desktop/knock

share|improve this answer
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.