I am running a cli-script, that requires a exec(‘sudo …’); call. I know it is not safe on the web, but how can it be done in cli? The script is executed by a user known as “btcdbit”, who is in the sudoers file.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In my experience setting the NOPASSWD option doesn’t always work and even if it does it seems unsafe. Seems to me that a better approach – if you’re able to use it – would involve using phpseclib to do sudo through SSH. eg.
The website “sudo in php” elaborates