[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT Re: root can't sudo



On Tue, 28 Sep 2010 03:26:42 +0200, T o n g <mlist4suntong@yahoo.com> wrote:

On Tue, 28 Sep 2010 02:58:05 +0200, Thierry Chatelet wrote:

I dont use sudo, but can you explain me,so I will go to bed with more
knowledge, why root would need sudo?

invoking my scripts embedded with sudo as root


I'm, not sure what you mean by "embedded" here, so my guess
is that you mean making something like this work for both
user and root:

user@machine ~/$ cat > aptupgscript.sh <<EOF
#!/bin/sh
echo Hello
sudo aptitude update
sudo aptitude upgrade
echo Update done by `whoami` || tee ~/done.log
EOF
user@machine ~/$ chmod a+x aptupgscript.sh
user@machine ~/$ ./aptupgscript.sh
Hello
Update done by user
user@machine ~/$ su
Enter password:
root@machine ~/$ ./aptupgscript.sh
Hello
Update done by root
root@machine ~/$

(Sorry for possible wrong details, I typed it from mind :D)


Thanks,
aL.

--
Alois Mahdal using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Reply to: