Last active
March 10, 2021 12:51
-
-
Save euikook/c1379f45f645fec1457f521851eea099 to your computer and use it in GitHub Desktop.
keep-persistent-ssh-session-using-autossh-and-cron
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
Host 1.2.3.4 autossh | |
Hostname 1.2.3.4 | |
User autossh | |
SendEnv LANG LC_* | |
IdentityFile ~/.ssh/autossh | |
ConnectTimeout 0 | |
HashKnownHosts yes | |
LocalForward 2222 localhost:22 | |
ServerAliveInterval 30 | |
ServerAliveCountMax 3 |
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
Host 1.2.3.4 autossh | |
Hostname 1.2.3.4 | |
User autossh | |
SendEnv LANG LC_* | |
IdentityFile ~/.ssh/autossh | |
ConnectTimeout 0 | |
HashKnownHosts yes | |
RemoteForward 2222 localhost:22 | |
ServerAliveInterval 30 | |
ServerAliveCountMax 3 |
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
Match User autossh | |
#AllowTcpForwarding yes | |
#X11Forwarding no | |
#PermitTunnel no | |
#GatewayPorts no | |
AllowAgentForwarding no | |
PermitOpen localhost:2222 | |
ForceCommand echo 'This account can only be used for [reason]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment