first commit

This commit is contained in:
Luxferre
2025-10-19 11:55:24 +03:00
commit 7954949269
8 changed files with 620 additions and 0 deletions
Executable
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
# Outport: a simple script to expose reverse tunnels via SSH
# Usage: outport.sh {start|stop} user@host [port1] [port2] ...
# Created by Luxferre in 2025, released into public domain
SOCKET_PATH=/var/run/sshcontrol.sock
ACTION="$1"
TARGET="$2"
shift
shift
PORT_OPTS=""
case "$ACTION" in
start)
while :; do
[ -z "$1" ] && break
PORT_OPTS="$PORT_OPTS -R :$1:localhost:$1"
shift
done
MISC_OPTS="-o ServerAliveInterval=60 -o ServerAliveCountMax=15"
ssh -f -N -M -S $SOCKET_PATH $PORT_OPTS $MISC_OPTS $TARGET
echo "Tunnel started"
;;
stop)
ssh -S $SOCKET_PATH -O cancel $TARGET
ssh -S $SOCKET_PATH -O exit $TARGET
echo "Tunnel stopped"
;;
*)
echo "Invalid action (specify start or stop)"
;;
esac