In Linux, PHP runs the external command as root-sudo Implementation Method
Source: Internet
Author: User
In Linux, PHP runs the external command-sudo implementation method-Linux Enterprise Application-Linux server application information as root. The following is a detailed description. When I debugged the email server for a friend half a year ago, I found that super was not needed. I only needed sudo in Linux and did not dare to enjoy it exclusively. I put it on the forum,
Assume that the user running apache is nobody and the password is nobody2002.
To add, delete, and modify users in php
1> related files and paths:
/Etc/sudoers
/Usr/bin/sudo
/Usr/sbin/useradd
/Usr/sbin/userdel
/Usr/sbin/usermod
2> log on to the Linux system as the root user, modify the/etc/sudoers file, or run the command mongodo. Add the following line.
Nobody ALL = (ALL)/usr/sbin/useradd,/usr/sbin/userdel,/usr/sbin/usermod
# Note that the vi/etc/sudoers method cannot be used for modification.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service