10 comments

You can probably do it using Timbuktu

by Brent Faulkner on May 12, 2008 at 5:10 am. Reply #

What about using cron? The ‘at’ command is not on my Leopard machine but that might work as well.

by andrej on May 12, 2008 at 7:47 am. Reply #

2andrej: Haven’t tried, but I guess cron won’t work for the same reason as

“screen -d -m bash -c “sleep 30; screencapture /Users/John/login.png””

didn’t work. The user which is running the command doesn’t have access to the active screen. Maybe it can be done with VNC (run server, then connect and use VNC client to make the screenshot)? Unfortunately, I don’t have time to try that, maybe someone will take it as inspiration :)

by ziizii on May 12, 2008 at 9:41 am. Reply #

For sure you can do this via ARD, probably via screen sharing too, though the screen shot will be captured on the machine that you are using to remote into your logged out machine from.

The ARD Send Unix command (as root) screencapture /Users/ladmin/Desktop/login.png where ladmin is my local account worked with no problem, great if you have ARD.

You can use ssh to run the same command, though you may need to use sudo, which means that you’ll need an admin account to ssh into.

Finally, a cron or launchd task run as root should do it.

by al on May 12, 2008 at 3:01 pm. Reply #

Ideally, I am looking to do this without having to use another machine (ARD or SSH). Have you tried using cron or launchd to accomplish this? The screen manager approach was close, however, the screenshot came up blank.

by john on May 12, 2008 at 3:16 pm. Reply #

I tried the ssh, logging in as my local admin account and using sudo su – to switch to root, but when I run the screencapture I get nothing but black.

I also tried both the launchd and cron and still got black… Not quite sure what’s going on there.

As far as I know, the ssh should be the same as the ARD Send Unix, but the latter works and the former doesn’t. Will think on it some more, try to find out what the difference is.

by al on May 13, 2008 at 6:51 am. Reply #

Thanks for taking the time to tinker with this…it’s a rather addicting problem to try and figure out :) I’m on to a few ideas that I’ll share tonight/tomorrow…

by john on May 13, 2008 at 7:17 am. Reply #

Every user gets their own copy of the window server. So, you have to be logged in as whatever user actually shows the login window to have a chance of taking a screen shot of it. Not sure Grab.app will run as root, though, the login session may not have a full user account for running a GUI application, so this may still not work.

by Uli Kusterer on May 14, 2008 at 7:14 am. Reply #

You need to connect via ssh from another mac.
Enable remote login on the target computer for a specific user, take not of the ssh address it gives you.
Also enable quick user switching then switch out to login screen (while remaining logged on your network connection will remain active)
On your second mac open terminal and enter ssh @, it will prompt for user verification.
Then enter:
cd ~/Desktop
sudo screencapture -ttiff loginwindow.tiff
This will create a screenshot of the target mac and save in format .tiff
It will be saved on the Desktop of the target computer.

This is best done on a mac that has a higher resolution than the target computer, otherwise you will need to crop the screenshot.

by Chris on Jun 10, 2009 at 11:17 pm. Reply #

I don’t know whether you managed to solve this without the need for a second machine as some time has passed since you first posted.

here is the solution you were looking for:

sudo screen -m -d bash -c “sleep 90; screencapture /Users/USERNAME/Desktop/loginscreen.png”

you were close you just needed to prefix with ‘sudo’

credit where its due to these guys over at mac os hints http://www.macosxhints.com/article.php?story=2003031107163856

by Deon on Dec 4, 2009 at 6:21 pm. Reply #

Post a comment:

Required.

Required. Not published.