Gentoo Archives: gentoo-user

From: Richard Fish <bigfish@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] sudo echo cannot write to /etc/ files ?
Date: Wed, 06 Jul 2005 19:19:28
Message-Id: 42CC2D3A.7060104@asmallpond.org
In Reply to: Re: [gentoo-user] sudo echo cannot write to /etc/ files ? by Holly Bostick
1 Holly Bostick wrote:
2
3 >Richard Fish schreef:
4 >
5 >
6 >>BTW Holly,
7 >>
8 >>You should recognize that from a security standpoint allowing yourself
9 >>to execute bash is really giving yourself "blanket permissions to sudo
10 >>to all commands". You might as well make life easier on yourself and
11 >>just make your sudo settings "ALL=(ALL) NOPASSWD: ALL".
12 >>
13 >>My $.02.
14 >>
15 >>-Richard
16 >>
17 >>
18 >>
19 >
20 >Thank you for the heads-up, Richard, but it would seem that that isn't
21 >quite true-- I did a test:
22 >
23 >
24 > sudo bash -c /etc/init.d/samba restart
25 >
26 >
27 >
28
29 Remember that the -c option for bash is a single argument, not the rest
30 of the line. The 'restart' is being seen as a separate argument to
31 bash, not as part of the command for bash to execute, if that makes any
32 sense! It will work if you do:
33
34 sudo bash -c "/etc/init.d/samba restart"
35
36 -Richard
37
38 --
39 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] sudo echo cannot write to /etc/ files ? Holly Bostick <motub@××××××.nl>