Link Search Menu Expand Document

Port knocking and ssh proxycommand

When you use a port knocker like knockd you might want to do the knocking automatically from your ~/.ssh/config using "ProxyCommand".

Example Config

Host myserver
   User myuser
   Host myserver.com
   ProxyCommand bash -c '/usr/bin/knock %h 1000 2000 3000 4000; sleep 1; exec /bin/nc %h %p'
It is important not to forget the "exec" before invoking netcat! See also