Monday, December 06, 2010

Mac OS login screen capture

This article is actual useful for 'Bloggers'. Some times you may wish to get the screen shot of your login screen for your Mac. You can do it by photo camera with weak quality ;) or use the software method. On systems below 10.5 you could write a script with screen shot delay procedure, run it, and do Log Out. Then your script get the screen shot of your login screen and write it on your disk. Unfortunately or fortunately ;) the Leopard system 10.5 or even SL 10.6 has a protection from such tricks. Yes, any 'spy trojan' can't do this trick by this and send your screen shot to owner. We can't do screen shot also. There is a more complicated method which will allow you to do that. Here is how.

To make this working we should use other computer with ssh access and open the ssh connection on your host computer. The command stroke is long and the good idea to make an alias for it in .profile file of your current user. After this we should connect the host computer by current user and we must know login and password of this user. ;) Then we give the command in terminal and our screen shot will be saved in location pointed in our magic stroke. It sounds complicated, so we will look on it step by step.
On the first step we will add a stroke to .profile file:
alias sc='sudo launchctl bsexec `ps ax | grep [l]oginwindow | cut -c 1-5` screencapture -x /Users/username/screen.png'
Where 'username' is your current user login name. Change it for your system.
On the second step enable ssh access to your system (see screen shot below). Follow "System Preferences... → Sharing". Check box must be enabled. Take a look - "Only these users" will restrict access additionally.

On the third step, if you use WiFi connection check out "System Preferences... → Network → AirPort → Advanced... → Disconnect when logging out" Check box must be disabled. (see screens hot below) If you have wired connection skip to next step.

On the forth step check your computer IP address and log out. From other device login to it and give the "sc" command. I used iPod Touch (see screen shot below):
When you login again, you'll find your screen shot in your active user home directory.
Easy, isn't it? ;)

No comments: