Running root commands as user
After a few hours work I have managed to set up pptd so that my daughter can log into her account at Imperial College.
My problem now is that I need to have a script that she can run if she wants to log in. She will have to invoke a couple of root commands and I do not want to give her the root password What she needs to do to set up networking is: Quote:
|
If you add the following line to /etc/sudoers,
Code:
daughter ALL=NOPASSWD:/usr/sbin/pppd call imperial dump debug logfd 2 nodetach require-mppe,/sbin/ip route add default dev ppp0 You will probably wish to incorporate those commands in a script, but that script can be run by your daughter and the calls to those two commands will get executed without password prompting. Use 'man sudoers' for information on additional options. |
Do I really have to use visudo to edit this rather than kdesu kate?
|
Quote:
As explained in "man 8 visudo": Quote:
|
So I have this in sudoers
Quote:
Quote:
|
Does your script have a 'sudo' in front of the command?
sudo /usr/sbin/pppd call imperial dump debug logfd 2 nodetach require-mppe |
I think I have solved that with chmod +s /usr/sbin/pppd
|
Oops! Ok added sudo
but now I have this - Quote:
|
ln -s /usr/sbin/pptp /usr/bin/pptp
seems to solve that. Nearly there |
One more problem;
Quote:
If I separate them into one command in each of two scripts it is OK. How do I get them to work togrther in one script? |
Quote:
|
Quote:
|
Yes I had realised that. The problem was that I had left sudo out of the script and I had reset it to -s when the penny dropped.
|
All times are GMT -5. The time now is 12:26 PM. |