♦ Screen sharing on OS X Lion without asking

Mac OS X’s built-in Screen Sharing feature changed slightly between Snow Leopard and Lion. Before, it was a straight-up [VNC](http://en.wikipedia.org/wiki/Virtual_Network_Computing) server, and you could connect to and control the remote computer with just a password. With Lion, when you try and connect to a machine using the built-in [Screen Sharing app](http://docs.info.apple.com/article.html?path=Mac/10.6/en/14065.html), you get this pop-up:

Screen Shot 2012 01 01 at 2 23 26 PM

This happens when the remote computer has someone logged in with a different account than yours — in this case, my wife’s account is logged in, and I want to go in and troubleshoot something remotely. (This doesn’t happen if you have the same username and password on both machines, but I haven’t been able to test this.)

This new behaviour is useful if you want to log in to your own account, without disturbing whoever’s using the computer. My problem, though, is with having to “ask to share the display”: what if there’s nobody on the other side to click “allow”? This happens to me regularly when I’m out, or errm when I’m in the bedroom and don’t want to walk to the living room _don’t judge me!_ ermm.

Turns out there are a couple of ways to get around this, as long as you have the currently logged-in user’s password:

__Connect via Finder__. This works best on a local network, when you can see your other computer under the “SHARED” panel on the Finder’s sidebar. Clicking “Share Screen” will bring up some options:

NetAuthAgent

From here, you can log in as the current user, and not have to ask for permission.

__Send user and password in VNC request__. Just log in as follows when Screen Sharing asks for where to connect:

“user:password@server-address“

…and you’ll get into that user’s screen, no questions asked. This works a few ways, e.g. by entering this into the “connect” dialogue box of the Screen Sharing app (in /System/Library/Core Services), in Terminal.app:

“open vnc://user:password@server-address“

Finally, you can save “vnc://user:password@server-address“ as a bookmark in Safari. Note that storing your account password in a bookmark is probably a terrible idea, but then, so is having to get up from the bedroom to walk to the living room.