Skip to content

Instantly share code, notes, and snippets.

@vpnwall-services
Created October 30, 2020 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpnwall-services/1a1cb53e071d2b7a09c2d7becab4acfc to your computer and use it in GitHub Desktop.
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
#!/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