Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   OT root can't sudo (http://www.linux-archive.org/debian-user/433004-ot-root-cant-sudo.html)

T o n g 09-28-2010 09:42 PM

OT root can't sudo
 
On Tue, 28 Sep 2010 16:14:24 +0200, Alois Mahdal 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: . . .

Thanks for the clear illustration. Yep, that's what I meant.

Besides, I share my aliases between my normal account and root account,
many of them are using sudo and I don't want to define two sets for the
same functionalities.

cheers

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: i7tnh0$75o$1@dough.gmane.org">http://lists.debian.org/i7tnh0$75o$1@dough.gmane.org

"B. Alexander" 09-29-2010 12:30 AM

OT root can't sudo
 
Another way to do it would be to have the "invisible" sudo similar to

NEEDSUDO=""
if [ "`id -u`" != 0 ] ; then
* NEEDSUDO="sudo"
fi
echo abc | $NEEDSUDO tee /tmp/t


Then, if the uid is not 0 (root), then it inserts the sudo line...If run by root, then NEEDSUDO is empty.

--b

On Tue, Sep 28, 2010 at 5:42 PM, T o n g <mlist4suntong@yahoo.com> wrote:


On Tue, 28 Sep 2010 16:14:24 +0200, Alois Mahdal 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: . . .



Thanks for the clear illustration. Yep, that's what I meant.



Besides, I share my aliases between my normal account and root account,

many of them are using sudo and I don't want to define two sets for the

same functionalities.



cheers



--

Tong (remove underscore(s) to reply)

*http://xpt.sourceforge.net/techdocs/

*http://xpt.sourceforge.net/tools/





--

To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org

with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: http://lists.debian.org/i7tnh0$75o$1@dough.gmane.org


All times are GMT. The time now is 10:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.