I'm not the administrator, so I'm not in the sudo list. How can I shut down the computer from command line without sudo? As I can shut down the computer from GUI, I must be able to get the privilege from somewhere... Thanks.
Asked
Active
Viewed 1,084 times
0
-
Most of the answers to that question won't work here, because this user doesn't have sudo access (and so, I assume, no access to edit sudoers to give himself/herself access). – thomasrutter Feb 05 '15 at 01:12
-
1What happens if you press the power button on the case? – wlraider70 Feb 05 '15 at 03:27
-
@wlraider70 then I can choose from "Lock", "suspend", "restart" or "shut down" in the pop up window using arrow key (or mouse), but this is just like shortcut and still in GUI, not command line... – dlz Feb 05 '15 at 22:25
1 Answers
0
The privilege to shut down or restart without root is managed by ConsoleKit.
While the mechanism for how this works is changing as a result of systemd and logind, sending the following ConsoleKit message should still work to shut down without root:
/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

thomasrutter
- 36,774
-
Thanks for the answer. But my terminal returns: "Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files" – dlz Feb 05 '15 at 22:18