Run Command Before Starting SSH Connection

This a quick hack I found while I was looking to run a knock script before connecting to servers which I have the SSH service protected with a knock sequence. In my setup I used the ProxyCommand option in the ssh_config file to loop over my loop-back interface.


You may also like...

4 Responses

  1. Damo says:

    SSHing to localhost is a bit too much IMO, you can replace it with nc %h %p

  2. Simon says:

    So I want to have my knock-script output to the terminal before running ssh, and that doesn’t seem to be working. Any idea why?

Leave a Reply

Your email address will not be published. Required fields are marked *