You want to use php to manage the configuration files of other applications in linux, such as the dnsmasq configuration file. Currently, the problem is that php runs under apache or nginx and has the permission to run www-data or nginx. The dnsmasq configuration file has the root permission. Is there any way for php to temporarily obtain dnsma... to use php to manage the configuration files of other applications in linux, such as generating the dnsmasq configuration file.
Currently, the problem is that php runs under apache or nginx and has the permission to run www-data or nginx.
The dnsmasq configuration file has the root permission.
Is there any way to allow php to temporarily obtain the read and write permissions of the dnsmasq configuration file, and do not grant php excessive permissions or allow other processes to access the read and write permissions of the dnsmasq configuration file?
Reply content:
You want to use php to manage the configuration files of other applications in linux, such as the dnsmasq configuration file.
Currently, the problem is that php runs under apache or nginx and has the permission to run www-data or nginx.
The dnsmasq configuration file has the root permission.
Is there any way to allow php to temporarily obtain the read and write permissions of the dnsmasq configuration file, and do not grant php excessive permissions or allow other processes to access the read and write permissions of the dnsmasq configuration file?
Add the running permission to the root group.