Created
November 1, 2013 16:55
-
-
Save stantonk/7268379 to your computer and use it in GitHub Desktop.
tunnel for vnc
This file contains hidden or 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/sh | |
# your router config | |
ROUTER_PUBLIC_IP=home | |
ROUTER_OPEN_PORT=1234 | |
# your remote computer, behind the router | |
REMOTE_PORT=5900 | |
REMOTE_LAN_IP=10.0.1.1 | |
# port on your local machine you want to connect to the REMOTE_PORT at REMOTE_LAN_IP via ROUTER_PUBLIC_IP:ROUTER_OPEN_PORT | |
LOCAL_PORT=5909 | |
echo "Establishing tunnel to $REMOTE_LAN_IP:$REMOTE_PORT through $ROUTER_PUBLIC_IP:$ROUTER_OPEN_PORT on local port $LOCAL_PORT..." | |
ssh -p $ROUTER_OPEN_PORT -f -N -L $LOCAL_PORT:$REMOTE_LAN_IP:$REMOTE_PORT $ROUTER_PUBLIC_IP | |
echo "Success." | |
echo "Opening ScreenSharing...connect to localhost:5909" | |
open /System/Library/CoreServices/Screen\ Sharing.app/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment