Answer the question
In order to leave comments, you need to log in
(*.sh;*.php) How to make the script itself request administrator rights?
I want to make a script that will add information to files that only the administrator is allowed to write to. So I want to know what command is there through sh or through php in order to automatically receive administrator rights, or at least so that the script itself asks for the administrator password and does not have to run it on behalf of the administrator. (OS: Debian 8)
Answer the question
In order to leave comments, you need to log in
if [ $EUID != 0 ]; then
exec sudo $0 "[email protected]"
exit 0
fi
sudo+expect. but not secure, as well as disabling the administrator password.
Your site does not have the right to manage the root in any way, it is strictly prohibited.
If you still want to manage it, raise the daemon on the port and knock on it using php.
And the demon, in turn, will control. BUT in no case should Apache be able to log in as root.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question