Created
March 27, 2020 18:30
-
-
Save EmbeddedAndroid/3258e1fc0e7f301f3f00d531be43ff9b to your computer and use it in GitHub Desktop.
SSH Reverse Tunnel Dockerfile Entrypoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
chmod 600 /root/.ssh/pkey.pem | |
echo "${SERVER_HOSTNAME},$(getent hosts ${SERVER_HOSTNAME} | awk '{ print $1 }') ${SERVER_ALGO} ${SERVER_HOST_KEY}" > /tmp/known_hosts | |
autossh -M 0 -o "ServerAliveInterval 10" -o "ServerAliveCountMax 2" -o "UserKnownHostsFile /tmp/known_hosts" $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment