Created
April 14, 2020 08:43
-
-
Save gintsmurans/d4c4414a295f3850ad689320ec28cef3 to your computer and use it in GitHub Desktop.
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 | |
# | |
# Make sure you have screen installed (on debian). On Arch linux no screen is required. | |
# Debian: | |
# apt-get install screen | |
# | |
# Monit example: | |
# check process ssh-tunnel matching "^ssh -N sshtunnel" | |
# user root | |
# start program = "/root/ssh_tunnel.sh" | |
# if does not exist then start | |
# | |
# See ~/.ssh/config for ssh-tunel | |
# Example: | |
# nano ~/.ssh/config | |
# Host sshtunnel | |
# HostName [hostname] | |
# User root | |
# ServerAliveInterval 15 | |
# ServerAliveCountMax 3 | |
# | |
# RemoteForward 0.0.0.0:2201 localhost:22 | |
# | |
# screen -dmS ssh-tunnel ssh -N sshtunnel | |
ssh -N sshtunnel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment