I've just installed OS X Server. Whenever I try to shut it down (as a local interactive user), I keep seeing a prompt that requires me to enter an admin's name and password before proceeding with the shutdown:
Shutting down may cause other users logged into this computer to lose unsaved changes.
I keep seeing this dialog even though there is nobody else connected to the machine.
Question is, how can I disable this dialog? I mean, let anybody who is logged in locally to shutdown the machine without entering an administrator password (or even without entering their own password?) I see this is not a security issue since with physical access, they can just press the power button.
My original intention is to use the living room's iMac as an Xcode build server, primarily to run unit tests. The machine starts and automatically logs in to a non-privileged account to make it convenient for people to use it to play videos and such. It would be nice to have this machine run unit tests as well, and it's really not critical if a build/run gets canceled mid-way because the machine is shutting down.
Server version: 4.1 (14S1092)
OS X: 10.10.3 (14D136)
Best Answer
One possible way could be by using a terminal command:
This immediately kills all processes and shuts your system down in a fairly nice manner.
As a normal user you could initiate this by
But the problem with password prompt remains, this time in the terminal.
Having a closer look to the sudo configuration file
/etc/sudoers
I found:Check whether your account is already in the
wheel
oradmin
group by issueinggroups
in the terminal. If that is the case, just uncomment the line with%wheel
NOPASSWD or by addingNOPASSWD
at the proper position of theadmin
line above (thewheel
line shows you how to do this). For instance:Here my user is already in the
admin
group, therefore I would just addNOPASSWD
in the sudoers line like this:Now you should be able to fire up a
without being asked for a password. To finalize my solution you could create an app with automator which executes this
sudo shutdown -k now
command as a bash script.If you want to reboot the server instead, use