Screen Sharing over SSH

I occasionally need to get access to my Mac remotely, but it's hiding behind a firewall. To get in through the firewall, I just need to use an SSH port forward command, like this:

ssh serverexternalip -L 1202:workstationinternalip:5900

For those of you not familiar with SSH port forwarding, this command connects to my server on its publicly accessible IP (serverexternalip), and then opens the local port 1202 and connects it to the remote host workstationinternalip on port 5900.

Port 5900 is the port Apple uses for its screen sharing application.

After these steps, I can open the Screen Sharing application and connect to localhost:1202, which transparently connects to the remote workstation through the SSH tunnel.

Obviously, this requires that the SSH session remain open as long as you're working in Screen Sharing.

1 Comments

Thanks for sharing your article.

Leave a comment


Type the characters you see in the picture above.

Who's this guy?

Aaron Longwell is Chief Web Craftsman at New Media Logic Corporation in Coeur d' Alene, Idaho. As a professional software developer for 12 years and a student of public policy, he occasionally has interesting things to say about software, technology, culture and politics.

Subscribe to feed Subscribe to my RSS Feed

  • View Aaron Longwell's profile on LinkedIn
  • Recommend Me