Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Capture screenshots of the login screen System
I'm not sure how practical this is, but if you've ever wanted to take a screenshot of the login screen, here's how. You'll need a second machine on the network in order to do this (Mac or PC, as long as it can run SSH), along with root access. Kirk McElhearn, posted this to the X-Unix mailing list; you can subscribe here.

On the Mac whose screen you wish to capture, make sure Remote Login is enabled on the Sharing system preferences panel. Also note that machine's IP address before you close the panel; assume it's 1.2.3.4 for this example. Then logout.

On the other machine's Terminal application, type ssh -l your_username 1.2.3.4 (replace 'your_username' with your user name on the other machine, and 1.2.3.4 with the actual IP address). Once connected, just type sudo tcsh to create a root shell, and then:
screencapture /path/to/save/picture.pdf
I used the Desktop for my normal user as the path, just to make it easy to find after logging in. Hit return, and the picture is saved. Login to the original Mac again, and double-click the image on the desktop to see a shot of your login screen. When I tested this, I had to add the PDF extension -- without it, Preview refused to open the image.

I'm not sure how useful this is if you're not an author, but there you have it!
    •    
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[22,385 views]  

Capture screenshots of the login screen | 22 comments | Create New Account
Click here to return to the 'Capture screenshots of the login screen' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Capture screenshots of the login screen
Authored by: brandonedling on Mar 11, '03 10:45:32AM

You'll need a second machine, but why doesn't VNC work?



[ Reply to This | # ]
Capture screenshots of the login screen
Authored by: filburt1 on Mar 11, '03 10:54:04AM

You might be able to use a cron job as well and just log out a minute or two before it runs.



[ Reply to This | # ]
command line vs gui
Authored by: robg on Mar 11, '03 11:35:54AM

Well, VNC would let you see the screen of the second machine, so I guess you could then the local screen capture to grab the screen. One potential problem with this could be scaling -- if you're connecting to a desktop Mac that's running at 1600x1200 from a 1024x768 laptop, you'll have to take a couple of pictures and stitch them together with a graphics program (if you want a full quality image).

-rob.



[ Reply to This | # ]
command line vs gui
Authored by: kirkmc on Mar 11, '03 12:38:55PM

Does VNC not shutdown when you log out? That's one of the problems with getting screenshots. If not, you could just run SnapzPro from the command line as well.

Kirk



[ Reply to This | # ]
command line vs gui
Authored by: diamondsw on Mar 11, '03 02:23:25PM

That's why the VNC distribution comes with a script to relaunch the server after you logout. The problem is when you log out the window server shuts down and restarts, and so VNC needs to as well.



[ Reply to This | # ]
Capture screenshots of the login screen
Authored by: lamon on Mar 11, '03 11:05:23AM

You can also use the command 'at' to schedule the command, say, 2 mn from now, I imagine, and then log out (not tested). Tou don't need another machine that way.



[ Reply to This | # ]
Capture screenshots of the login screen
Authored by: Spencerian on Mar 11, '03 11:33:43AM
Well, I am an author and I do find this very useful. In the past I've been stumped at this trick, which I thought was done photographically. This was one of a very, very few items that escaped me in my mastery of OS X. The silly part of it is that it's so simple to understand why. Thanks for the hint.

[ Reply to This | # ]
Capture screenshots of the login screen
Authored by: kirkmc on Mar 11, '03 12:28:47PM

I spent a couple of hours researching this, checking on lots of web sites, and it was finally a colleague developer who suggested the hint. (I'm the one who posted this to the X-unix list.) Needing this for a book I'm writing, I couldn't understand how other authors had managed to get shots of this.

A notes: this only works when you are logged in as root. If not, you get a message saying something like window server not available. I don't know why this is the case.

Kirk



[ Reply to This | # ]
Root needed?
Authored by: incongruity on Mar 11, '03 02:50:05PM

Think security.

If you didn't need root access, this tip would be a serious security flaw.



[ Reply to This | # ]
Root needed?
Authored by: kirkmc on Mar 12, '03 03:46:43AM

Why?


Kirk



[ Reply to This | # ]
Root needed?
Authored by: robophilosopher on Aug 11, '03 10:36:09PM

The reason why is that this trick doesn't only work for the login screen; you can capture the screen at any point this way. If you didn't need root access, then you could, in theory, capture screenshots of what someone else was doing from another room. Particularly a problem on shared computers.



[ Reply to This | # ]
"Screen"
Authored by: XSage on Mar 11, '03 11:54:45AM

A while back Macosxhints ran a write-up on screen, which allows a command to run in the background even with a terminal detached. To use screen to take a screenshot of the login window, use the following command:

screen -m -d bash -c "sleep 120; screencapture ~/Pictures/picture.pdf"

That will give two minutes to log out so that screencapture can take a shot of the login stuff. To change the time just change 120 to however long you like :-)



[ Reply to This | # ]
"Screen"
Authored by: kirkmc on Mar 11, '03 12:36:02PM

I just tried this and it didn't work for me...

Kirk



[ Reply to This | # ]
"Screen"
Authored by: ashill on Mar 11, '03 12:54:29PM
Worked for me when prefixed with sudo, but not when executed as myself. i.e.
sudo screen -m -d bash -c "sleep 120; screencapture /Users/username/Desktop/loginscreen.pdf"
(I don't know if ~ will work as a substitute for /Users/username; it might, but entering the path explicitely is certain to work.)

[ Reply to This | # ]
"Screen"
Authored by: XSage on Mar 11, '03 01:23:20PM

Ashill is right: t needs to be a sudo process to work. You probably need a full path too. Sorry about that...



[ Reply to This | # ]
"Screen" - didn't work in 10.3.3
Authored by: soosy on May 06, '04 11:34:06AM

Just tried in 10.3.3... I successfully get a file, but it is only 4k and of course comes up blank in Preview. I have 2 monitors attached....



[ Reply to This | # ]
Capture screenshots of the login screen
Authored by: merlyn on Mar 11, '03 12:03:46PM
I find ssh user@remote.host easier to remember than ssh -l user remote.host.

[ Reply to This | # ]
Capture screenshots of the login screen
Authored by: oem on Mar 11, '03 02:26:17PM

Even Simplier? Don't forget you're on a Mac :o) and was about giving a simple hint.

at the login window : Typing the mostly well known keycombo
command-shift-3.

---
I luv mac, Vindoze Sucks



[ Reply to This | # ]
ARRRRRRGGGGGGGG !!!
Authored by: oem on Mar 11, '03 02:28:17PM

I just checked it and does not work anymore.

I'm sure I could do it in prior version of 10.2 (maybe was it in 10.0.x ??) but I also did screenshots of the boot process !!!

All was then recuperable on the root's desktop folder.

apparently this feature (bug?) is not available anymore.
in list of User or Name & Password Login options.
I forgot about this but now that I can't do it I miss it.
Sorry for this NON-Hint
olive

---
I luv mac, Vindoze Sucks



[ Reply to This | # ]
ARRRRRRGGGGGGGG !!!
Authored by: MarsViolet on Mar 12, '03 12:14:26AM

Yes, I remember this working! It used to save the screenshot on the Desktop of the root account. I haven't tried it for a while. Damn shame it's gone.



[ Reply to This | # ]
And ARD doesn't do it for you?
Authored by: johnd on Mar 14, '03 02:17:16PM

Instead of CLI - if you are already using two machines, just observe the screen in a window using Apple Remote Desktop. You can use cmd-shift-4 on the admin station and capture anything on the observed system.

The Mac way.



[ Reply to This | # ]
Capture screenshots of the login screen
Authored by: mykulh on Mar 29, '10 01:38:26AM

sudo screen -m -d bash -c "sleep 120; screencapture ~/Pictures/picture.pdf"

I found this worked for me if but the image was not recognized, had a look at the make up and it was a PNG

so changed to

sudo screen -m -d bash -c "sleep 120; screencapture ~/Pictures/picture.png"

worked like a charm.



[ Reply to This | # ]