Created
October 30, 2020 10:48
-
-
Save vpnwall-services/1a1cb53e071d2b7a09c2d7becab4acfc to your computer and use it in GitHub Desktop.
[Saltstack Execute tunnel for remote access] Saltstack Execute tunnel for remote access #bash #saltstack #ssh #tunnel
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/bash | |
salt 'mynode' cmd.run '/usr/bin/autossh -M 0 -o "StrictHostKeyChecking=no" -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -o ExitOnForwardFailure=yes -o "ServerAliveInternal=30" -o ServerAliveCountMax=3 -i /root/.ssh/id_rsa -NR 7999:localhost:22 myremoteuser@remoteserver.public -p 2222 &' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment