[GTALUG] Sudo in Script

William Park opengeometry at yahoo.ca
Sun Sep 15 12:21:36 EDT 2019


I think you're supposed to first "stop" apache, delete the logs, and
then "start" apache.  Anyways, to "sudo" without a password, do as root,
    cd /etc/sudoers.d
    echo "user ALL = (ALL) NOPASSWD: ALL" >> user
    chmod 440 user
-- 
William Park <opengeometry at yahoo.ca>

On Sun, Sep 15, 2019 at 12:01:28PM -0400, Stephen via talk wrote:
> I do work in a LAMP system.
> 
> When debugging I like to clear the Apache error file and save as null.
> 
> To continue error logging I have to restart Apache.
> 
> 1) Not a big deal, but is there an easier way?
> 
> I restart Apache in a script file that requires a Sudo command. That
> requires a password.
> 
> 2) Can I provide the password in the script file to avoid the prompt and
> save a little time?
> 
> Thanks!
> -- 
> Stephen
> ---
> Post to this mailing list talk at gtalug.org
> Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


More information about the talk mailing list