Skip to content

Instantly share code, notes, and snippets.

@gintsmurans
Created April 14, 2020 08:43
Show Gist options
  • Save gintsmurans/d4c4414a295f3850ad689320ec28cef3 to your computer and use it in GitHub Desktop.
Save gintsmurans/d4c4414a295f3850ad689320ec28cef3 to your computer and use it in GitHub Desktop.
#!/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