Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Since I upgraded to Mountain Lion, i've the feeling my Mac (early 2008 iMac) goes to sleep randomly when i'm connected through SSH.

It's there a way I can prevent my Mac to go to sleep when i'm connected over SSH ?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Caffeine prevents your Mac from falling asleep. Maybe, it can help you out with your issue too. The sleep isn't at all random, but in fact is set in the Energy Saver system preference as well from the terminal using pmset.

You could use pmset to inspect and change the sleep settings if you have admin rights on the remote.

share|improve this answer
    
I don't have time to write this as a full answer, but caffeinate is a command-line tool built-in to 10.8 that can also be used to prevent sleep temporarily. –  gabedwrds Nov 14 '12 at 15:25
add comment

You can manage your computer's power settings through

System Preferences -> Energy Saver

Within this pane, click on the Power Adapter tab, and drag the Computer Sleep slider all the way to the right, so that it is set to "Never." This will force the computer to stay awake 24/7. I have a laptop running 10.5 at my house that I have running as a file/web/home media server configured using these settings (though the preferences nomenclature is different on 10.5, the functionality is the same) and enjoy uninterrupted access - that is unless there's a problem with the node, but that's out of our control. Caffeine and caffeinate will also work as other users have noted, but this is the most up-front and user-friendly way to get this done as it involves a GUI interface and no third-party application.

share|improve this answer
    
Since i've an iMac, I don't have the Power Adapter tab. –  Matthieu Riegler Nov 14 '12 at 20:40
    
Naturally :) sorry about that, bit of an oversight. So, is there no Energy preference pane at all to regulate sleep/wake? –  soxman Nov 14 '12 at 21:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.