This is how I did it...assumeing my UID is 500...
First edit the /etc/sudoers file and add the following:
Code:
username ALL=(ALL) NOPASSWD: ALL
Where username is the username of the user you want to have sudo access
Then the script would look something like this...
Code:
#!/bin/bash
#
# Only username can use this script
if [ $(id -u) -ne 500 ] ; then
echo "You are not allowed to use this command"
exit
fi
# Now sudo into root with out password...
sudo su -
eixt
Replace the 500 with whatever the users uid is...
-Custangro