image 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:

  1. Open Automator (in your Applications folder) and choose Service from the list of templates provided and click the Choose button.
  2. In the left hand column under Library, select Utilities.
  3. In the second column, drag “Run Shell Script” to the right hand pane.
  4. 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”.
  5. 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 -suspend

    The entire command should be entered on a single line and note there is a space after “/Menu\”.

    mac1 Locking your Snow Leopard Mac’s Screen when connecting using VNC

    Completed Automator action, ready to save (click to enlarge)

  6. 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.
  7. Next open System Preferences –> Keyboard –> Keyboard Shortcuts and select Services in the left column.

    mac2 Locking your Snow Leopard Mac’s Screen when connecting using VNC

    Setting the keyboard shortcut (click to enlarge)

  8. 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_