Mar 8, 2011

Mac OS X: Screen Sharing

How to enable a screen sharing of a remote Mac (10.6) if you forgot to enable it and your Mac is behind a firewall?

This is the question I asked myself today when I desperately was in need to use some GUI on my Mac Pro at work place, while I am on a business trip right now and have my laptop with me :(

Same as always with the Mac OS X - it appeared to be very easy to implement.

So, you have a remote Mac "A", which is behind a firewall and you want to connect to it via an open domain "B" (to where ssh is possible) from your local Mac (a laptop, for example).

STEP #1

Enable an SSH tunnel via an open domain to you remote Mac. On your local Mac just open a terminal and enter the following:

ssh -N -L 3000:loginnameA@hostnameA:5900 loginnameB@hostnameB

The command will create a tunnel and hang. When you are done terminate the command and the tunnel will be disabled.

STEP #2
Open another terminal on your local Mac and ssh to your remote Mac to enable a screen sharing:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all

STEP #3
Start sharing the screen :)

In Safari enter the following URL: vnc://localhost:3000

Should work now :)

Disable screen sharing
SSH to your remote Mac and execute the command:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

Don't forget to terminate the SSH tunnel (Step #1).



Hope it helps some one to save time.

6 comments:

Sam Tseng said...

nice tips! thanks for sharing..

btw, i'm sam. the place u want to go that is mitsukoshi which is near by taipei 101. I just realized sogo is not around 101.

have a nice trip back!

Anar Manafov said...

Thanks a lot, man!
I hope to see you once again!

we keep in touch!

oakleyses said...

louboutin pas cher, nike free, polo ralph lauren outlet online, louis vuitton, polo outlet, nike air max, longchamp pas cher, jordan shoes, ray ban sunglasses, gucci handbags, tiffany and co, jordan pas cher, cheap oakley sunglasses, louis vuitton outlet, oakley sunglasses, christian louboutin uk, nike free run, sac longchamp pas cher, nike air max, oakley sunglasses, longchamp outlet, prada outlet, kate spade outlet, longchamp outlet, louis vuitton, oakley sunglasses wholesale, polo ralph lauren, longchamp outlet, christian louboutin outlet, chanel handbags, louis vuitton outlet, tiffany jewelry, michael kors pas cher, replica watches, replica watches, ray ban sunglasses, ugg boots, burberry pas cher, tory burch outlet, nike roshe, oakley sunglasses, louis vuitton outlet, ray ban sunglasses, prada handbags, ugg boots, nike outlet, christian louboutin shoes, uggs on sale, christian louboutin

oakleyses said...

guess pas cher, north face, lululemon canada, michael kors, michael kors outlet online, true religion outlet, oakley pas cher, nike free uk, michael kors outlet, abercrombie and fitch uk, hollister uk, true religion outlet, hollister pas cher, ray ban pas cher, polo lacoste, north face uk, michael kors outlet online, coach outlet store online, ray ban uk, mulberry uk, burberry handbags, michael kors outlet, hogan outlet, nike blazer pas cher, nike air max, nike air max uk, true religion outlet, uggs outlet, coach outlet, nike air force, nike air max uk, sac hermes, uggs outlet, michael kors outlet, michael kors, michael kors outlet online, nike roshe run uk, vans pas cher, true religion jeans, replica handbags, ralph lauren uk, sac vanessa bruno, burberry outlet, nike tn, coach purses, new balance, michael kors outlet online, kate spade, timberland pas cher

oakleyses said...

hermes belt, hollister, lancel, abercrombie and fitch, chi flat iron, instyler, north face outlet, louboutin, asics running shoes, nfl jerseys, ferragamo shoes, new balance shoes, mont blanc pens, vans outlet, celine handbags, hollister clothing, mcm handbags, mac cosmetics, beats by dre, giuseppe zanotti outlet, converse outlet, nike air max, longchamp uk, oakley, reebok outlet, bottega veneta, nike air max, timberland boots, insanity workout, nike trainers uk, gucci, lululemon, baseball bats, soccer shoes, soccer jerseys, north face outlet, valentino shoes, wedding dresses, hollister, nike roshe run, vans, ray ban, babyliss, jimmy choo outlet, nike huaraches, p90x workout, ghd hair, ralph lauren, herve leger, iphone cases

oakleyses said...

ugg,uggs,uggs canada, barbour uk, moncler outlet, coach outlet, ugg,ugg australia,ugg italia, moncler, thomas sabo, canada goose, moncler outlet, links of london, canada goose outlet, juicy couture outlet, moncler uk, pandora jewelry, montre pas cher, marc jacobs, replica watches, louis vuitton, moncler, canada goose jackets, swarovski, pandora charms, canada goose outlet, toms shoes, moncler, swarovski crystal, doudoune moncler, louis vuitton, moncler, pandora jewelry, ugg, barbour, louis vuitton, hollister, canada goose outlet, karen millen uk, ugg pas cher, supra shoes, canada goose, juicy couture outlet, louis vuitton, wedding dresses, pandora uk, canada goose, ugg uk, canada goose uk, louis vuitton