Last active
June 5, 2020 22:19
-
-
Save feldim2425/95a938fc6f97511058f802f73a186dec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allows scripts running as www-data (NginX or Apache Webserver) to reboot the machine | |
# | |
# Execute "systemctl reboot -i" as a shell command (PHP: shell_exec) | |
# This policy has been tested on Ubuntu 20.04 Server Version (Policy kit 0.105 which is also used in Debian stretch) | |
# | |
# Copy this content into "/etc/polkit-1/localauthority/50-local.d/99-www-reboot.pkla" | |
# To apply the changes restart the policykit with "systemctl restart polkit.service" | |
# | |
# Note: The "localauthority" direcotry can only be viewed by root. | |
[Allow www-data rebooting] | |
Identity=unix-group:www-data | |
Action=org.freedesktop.login1.reboot*;org.freedesktop.login1.set-wall-message | |
ResultAny=yes | |
ResultInactive=yes | |
ResultActive=yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment