linux - Run sudo command with password -


sudo command can used in following way

sudo -u <user_name> <command/script> 

but want know how include password want avoid user interactivity. also, admin, don't want disable password prompt sudo commands. how can achieve this. tried man sudo, not of help.

you can use -s switch reads password stdin, example:

~$  echo "yourpassword" | sudo -s <command> 

anyway, @thrustmaster said, not right way use sudo.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -