Ssh automagically knocks at server door: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 6: | Line 6: | ||
This was annyoing. There had to be a way to do this in one step. And it is. | This was annyoing. There had to be a way to do this in one step. And it is. | ||
---- | |||
A simple knocking-script can be found here: [[Raspberry Pi WebCam with 3G (Solarcam)#knock.sh]] | |||
=== The solution === | === The solution === |
Revision as of 12:43, 12 December 2018
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 had to be a way to do this in one step. And it is.
A simple knocking-script can be found here: Raspberry Pi WebCam with 3G (Solarcam)#knock.sh
The solution
Add this to .ssh/config:
ProxyCommand /bin/bash -c '~/bin/knock.sh; sleep 1; exec nc %h %p'