1

Execute custom bash script with sudo without passwd prompt

view story
linux-howto

http://askubuntu.com – I run ubuntu-12.04 desktop x86_64. I have a simple script that needs to be accessible from the Desktop and run as root: $ cat ~/Desktop/flash.sh #!/bin/bash - cd ~/tools sudo ~/tools/fastboot-HW.sh I've read this and that and that also. I modified my /etc/sudoers as follows: $ sudo cat sudoers Defaults env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # User privilege specification root ALL=(ALL:ALL) ALL root ALL=(ALL) NOPASSWD:/home/john/Desktop/flash.sh john ALL=(ALL) NOPASSWD:/home/john/Desktop/flash.sh root ALL=(ALL) NOPAS (HowTos)