I am using nanopi board/ Ubuntu TLS 20.04 focal
have a simpoole site using nginx web server
inside a the page there is a button to apply new time to the system using "exec(date --set='')"
I have tried all possible configuration to setup using sudo and even add www-data ALL:nonpassword to visudo
then grant folder /var/www/html access www-data:www-data and permission 777
but I cannot modfiy the system time or restart it using my website
even I can do thesse operations using command promot.
please help.!
date --set
requires superuser privileges, so you have to usesudo
. Probably you used wrong syntax either in yourexec
command on the webpage or in thesudoers
file. Have you checked your webserver logs? Error messages should be there...