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.


Does this work in OS X?:

touch /etc/nologin

Edit: It would seem to.

| 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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