Bug 1303892

Summary: reboot can now be run by unprivileged users
Product: [Fedora] Fedora Reporter: David Howells <dhowells>
Component: systemdAssignee: systemd-maint
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: johannbg, lnykryn, msekleta, muadda, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-02 13:10:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description David Howells 2016-02-02 10:56:20 UTC
Description of problem:

I found out by accident that the 'reboot' command can now be run by an unprivileged user - you don't need to be root to use it.

One thing I don't know is whether this user needs to be the user you're logged in as.

Version-Release number of selected component (if applicable):

systemd-222-13.fc23.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Go to unprivileged shell prompt.  Type reboot.  Hit enter.
2.
3.

Actual results:

System reboots

Expected results:

Should get an error message telling me that I don't have sufficient privilege for this.  System should not reboot.

Additional info:

I have /usr/sbin in my path because that directory contains some useful programs that can be run as an unprivileged user - wireshark for example.

Comment 1 Zbigniew Jędrzejewski-Szmek 2016-02-02 13:10:07 UTC
Yes, it's intentional. Users logged in at a physical console get a right to reboot the machine. This is done through policykit, see /usr/share/polkit-1/actions/org.freedesktop.login1.policy. You can always override this setting locally.

Comment 2 David Howells 2016-02-02 14:24:23 UTC
This seems to show the right way to override it:

    https://www.centos.org/forums/viewtopic.php?f=47&t=50936