Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a maintenance script that needs to run uninterrupted, so I'd like some way to disable local user logins. Right now, the solution is to send SIGSTP to the loginwindow process, which is suboptimal for several reasons. The most important of them is that the observed behavior is a login prompt that appears to accept the user's credentials but then hangs on a blank desktop before the menu bar or dock or desktop icons appear. This has led to users "fixing" the problem by rebooting the machine.

Is there a better way to disable local logins?

We currently use iHook, so if there's any way to abort a login from within the login hook, that would integrate nicely with our current setup. Unfortunately, Apple doesn't seem to have documented exactly what would cause Mac OS to abort the login.

share|improve this question

Does this work in OS X?:

touch /etc/nologin

Edit: It would seem to.

share|improve this answer
I'm not sure if that stops GUI logins. – Spiff Apr 9 '10 at 2:36
I just tried it, and GUI logins still work. – Wang Apr 10 '10 at 19:50

Get Apple Remote Desktop and then you can put the machines in to "Curtains Mode" which basically disallows a desktop user from doing anything.

I know ARD isn't free, but if you manage more than 10 or 15 Macs, it very quickly pays for itself in the way that it helps you do less work.

share|improve this answer

Your Answer


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.