Thanks for your help!
Unfortunately, putting meself into the sudoers file didn't help. I tried different combinations, like
Code:
ITS_ME ALL=NOPASSWD:/usr/sbin/pppoe-start
ITS_ME ALL=NOPASSWD:/usr/sbin/pppoe-stop
and
Code:
ITS_ME ALL=(ALL) /usr/sbin/pppoe-start
ITS_ME darkstar=(ALL) /usr/sbin/pppoe-start
The result is always the same: first I have to be at /usr/sbin so that the command "sudo pppoe-start" could even be recognised and then I get the following error message:
Code:
Sorry, user ITS_ME is not allowed to execute 'pppoe-start' as root on darkstar.
But your script
carboncopy was of great help to me! I finally managed to get access to the internet without root privileges. And that's how I did it:
1. I created a script with parts of carboncopy's code called "adsl" at /usr/local/bin, which I made executable with sudo privileges
2. I made it executable by all users, but only editable by root:
Code:
chown root.root /usr/local/bin/adsl
chmod a+rx /usr/local/bin/adsl
3. Put the following line into /etc/sudoers:
Code:
%users ALL=(ALL) /usr/local/bin/adsl
And now I can start and stop my internet connection with "sudo adsl start" and "sudo adsl stop".
This is how the script looks like:
Code:
#!/bin/sh
# Script /usr/local/bin/adsl
SUDO="/usr/bin/sudo"
# start script by sudo when
# not started by root
if [ -x $SUDO -a $UID -ne 0 ]; then
exec $SUDO $0 $*
fi
case "$1" in
'start')
/usr/sbin/pppoe-start ;;
'stop')
/usr/sbin/pppoe-stop ;;
'restart')
/usr/sbin/pppoe-stop
/usr/sbin/pppoe-start ;;
'status')
/usr/sbin/pppoe-status ;;
*)
echo "usage: $0 start|stop|restart|status" ;;
esac
Thanks again!