Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php shell_exec with root

# add sudoers for www data to execute without pass
sudo vi /etc/sudoers
www-data ALL=(ALL) NOPASSWD: ALL

# execute with sudo 
shell_exec('python3 script.py')
 
PREVIOUS NEXT
Tagged: #php #root
ADD COMMENT
Topic
Name
6+2 =