Locking your Snow Leopard Mac’s Screen when connecting using VNC
So as you probably know I have been supporting more and more Mac’s in my previously Windows Shop. Now I had to allow Windows home users to connect to their Macs in the office and lock their screens or monitors as they worked in case they were doing confidential or stupid stuff…
This should have been easy. Macs are supposed to be easier to use than Windows machines right? Well no dice. You could not do it with out modifying they system. I tried over and over using VNC, Logmein, PcAnywhere and more… Everyone of them would open my screen right on up, so anyone walking by could not only watch me work but also move the mouse or type on the keyboard! It was the end of the road when someone type hello into a spread sheet of a Production manager… Sonofabitch!
I found a hack courtesy of ArtOfGeek and added my Vine VNC server and a new port for the win! My favorite quote from the article has to be:
I know, enough with the chatter, get on with the tutorial! Just follow these steps and you’ll be locking your Mac running Mac OS X 10.6 Snow Leopard like it’s running Windows XP! Wait, did I just write that? Shudder. Sorry, I think I just threw up a little bit in my mouth.
Here is the nitty gritty for ya:
- Open Automator (in your Applications folder) and choose Service from the list of templates provided and click the Choose button.
- In the left hand column under Library, select Utilities.
- In the second column, drag “Run Shell Script” to the right hand pane.
- At the top of the right hand pane where you dragged the Run Shell Script action, click on the menu next to “Service receives” and choose “no input”.
- Copy and paste the following Terminal command into the empty text area of the Run Shell Script action:
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspendThe entire command should be entered on a single line and note there is a space after “/Menu\”.
Completed Automator action, ready to save (click to enlarge)
- Choose File–>Save, and give the new service a meaningful name like “Lock Computer” that will appear in the Services menu. Once you’ve done that, you can go to the Services menu (located in the current application menu, next to the Apple menu) and your newly created service should appear there.
- Next open System Preferences –> Keyboard –> Keyboard Shortcuts and select Services in the left column.
Setting the keyboard shortcut (click to enlarge)
- Scroll down to the bottom and under the General category, you should see your newly created service listed there. Select it, then Double-click close to the right side of the selected line to reveal a field where you can enter a custom keyboard shortcut. Enter an easy to remember but unique keyboard shortcut (I decided to go with ctrl+option+command+L), and then quit System Preferences.
That’s it! Go ahead and test your keyboard shortcut! That locked your screen right? Now you can install Vine VNC Server on your machine change the port that it is listening on to 1111 or something other than 5900. Connect to your Vine server using UltraVNC using the IP address and the port like this 192.168.1.1:1111. That will keep your Mac locked and allow you to log into your machine keeping the screen locked. If you try to lock the screen and log in on port 5900 (built in screen sharing) you will arrive at the login screen and defeat the purpose of this hack!
You can read the full post at ArtOfGeek here
_TheMacinAdmiN_






March 5, 2010 - 2:06 pm
Hey, thanks for the link back to my article. I don’t mind you reproducing my hint on your blog, my only request is that you remove the images so a) your readers aren’t using up my bandwidth if they’re not visiting my site, and b) it gives your readers a bit of incentive to visit my site to see the ‘full’ hint so you send a bit more traffic my way.
I run my blog off an aging G4 tower and a DSL connection, so bandwidth and performance aren’t exactly abundant. It’s enough for my own blog, but if a lot of other blogs are leeching images from my server, it’s going to take a hit on my blog’s performance and my blog isn’t supported by advertising or any other source of income, it’s just a labour of love that I pay for out of my own pocket.
Otherwise, thanks again for the link and credit for the hint!
Click to Reply to This Comment.
Karl L. Gechlik | AskTheAdmin.com Reply:
March 5th, 2010 at 2:18 pm
No problem Madgunde we understand how it is running a website for fun and not profit. And just a FYI by clicking http://bit.ly/cP3KCF you can get awesome accounts with unlimited everything and you can even resell space and domains. We are using this and its great.
Click to Reply to This Comment.