Ssh automagically knocks at server door

From Wurst-Wasser.net
Revision as of 12:35, 12 December 2018 by Heiko (talk | contribs) (Created page with "=== The issue === I secured my server with knockd. So I need to knock on his door (ports) in order to start an ssh.session. * The usage ** first I started a shell script t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The issue

I secured my server with knockd. So I need to knock on his door (ports) in order to start an ssh.session.

  • The usage
    • first I started a shell script that did the knocking
    • then I had to launch ssh

This was annyoing. There hat to be a way to do this in one step. And it is.


The solution

ProxyCommand /bin/bash -c '~/bin/knock.sh; sleep 1; exec nc %h %p'