#!/bin/sh USER= HOST= while true; do ssh -NC -o ServerAliveInterval=5 \ -o UserKnownHostsFile=/dev/null \ -o StrictHostKeyChecking=no \ -R '<int IP>:50022:<rem IP>:22' \ $USER@$HOST sleep 5 done