Created
July 30, 2014 14:45
-
-
Save simlun/50a10c4ea96ee7c62da0 to your computer and use it in GitHub Desktop.
Connect to an x11vnc server over an SSH tunnel from a Mac
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 | |
# Tip: An executable script given a `.command` suffix will be double-clickable on Mac OS X | |
REMOTE_SSH_USER=pi | |
REMOTE_SSH_HOST=192.168.0.17 | |
REMOTE_VNC_SERVER_PORT=5900 | |
LOCAL_VNC_PORT=5901 | |
# This is the RealVNC Viewer, works with Chicken of the VNC too | |
LOCAL_VNC_CLIENT=/Applications/VNC\ Viewer.app/Contents/MacOS/vncviewer | |
ssh -f -L 127.0.0.1:$LOCAL_VNC_PORT:localhost:$REMOTE_VNC_SERVER_PORT $REMOTE_SSH_USER@$REMOTE_SSH_HOST x11vnc -safer -localhost -rfbport $REMOTE_VNC_SERVER_PORT -nopw -once -display :0 -timeout 60 -no6 -noipv6 && sleep 3 && $LOCAL_VNC_CLIENT 127.0.0.1:$LOCAL_VNC_PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to put LOCAL_VNC_CLIENT between quotes. So the line should bee:
ssh -f -L 127.0.0.1:$LOCAL_VNC_PORT:localhost:$REMOTE_VNC_SERVER_PORT $REMOTE_SSH_USER@$REMOTE_SSH_HOST x11vnc -safer -localhost -rfbport $REMOTE_VNC_SERVER_PORT -nopw -once -display :0 -timeout 60 -no6 -noipv6 && sleep 3 && "$LOCAL_VNC_CLIENT" 127.0.0.1:$LOCAL_VNC_PORT