public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Holly Bostick <motub@planet.nl>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] sudo echo cannot write to /etc/ files ?
Date: Wed, 06 Jul 2005 16:25:21 +0200	[thread overview]
Message-ID: <42CBE9D1.5050203@planet.nl> (raw)
In-Reply-To: <Pine.BSO.4.58.0507060958550.1852@ida.bway.net>

A. Khattri schreef:
> On Wed, 6 Jul 2005, Holly Bostick wrote:
> 
> 
>>Echo is in the sudo-ed group, and echo isn't the problem-- the problem
>>is that permission is refused to write to the file itself (which is an
>>error *from* echo, so it would seem that echo itself is OK as far as
>>sudo goes). Which means that I have to su anyway, to echo to the file,
>>which really isn't the point of the exercise.
> 
> 
> What is in /etc/sudoers?
> 
> Either the problem is there or maybe its because in some shells, echo is a
> built-in command and in others its not (so /bin/echo comes into play).
> 
> 

Well, I'm not going to copy my entire file, but I've got /usr/bin/echo
sudoed (because that's what 'which echo' said was the path to echo).

But doing a locate echo reveals that there is also a /bin/echo.... oh,
and la /usr/bin/echo reveals it to be a symlink to /bin/echo. Fine. What
 in the bloody blue blazes does that tell me? Changing visudo to allow
/bin/echo rather than /usr/bin/echo didn't do a thing.

I'm using bash, like a boring person. Looking (searching, actually)
through man bash, I can see that echo is a built-in-- do I have to sudo
bash as well? And in any case, echo isn't refusing to run-- if I run

secho $JAVA_HOME, I get a return... but it's the return of the *user's*
JAVA_HOME, rather than the *system* JAVA_HOME.

This supports my theory that this is a regular su shell and not an su -
shell, which is not much help to me in this situation (for echo to write
to the /etc/files, I need UID 0).

So I suppose I could find this in man sudoers, but that's almost as bad
as man bash for trying to find something when you're not quite sure what
you're looking for.

Is there a way to get sudo to behave as a login shell when sudo-ing
rather than just a regular su? And is that a scalable or global change
(limitable would be nice)?

Holly
-- 
gentoo-user@gentoo.org mailing list



  reply	other threads:[~2005-07-06 14:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-06 13:52 [gentoo-user] sudo echo cannot write to /etc/ files ? Holly Bostick
2005-07-06 14:02 ` A. Khattri
2005-07-06 14:25   ` Holly Bostick [this message]
2005-07-06 14:20 ` David Morgan
2005-07-06 14:20 ` gentoo
2005-07-06 15:21   ` Holly Bostick
2005-07-06 15:29     ` Christoph Gysin
2005-07-06 15:39     ` gentoo
2005-07-07  3:42     ` Boyd Stephen Smith Jr.
2005-07-07  5:31       ` Richard Fish
2005-07-06 14:22 ` Edward Catmur
2005-07-06 14:54   ` Holly Bostick
2005-07-06 15:12     ` David Morgan
2005-07-06 15:26       ` Neil Bothwick
2005-07-06 15:28       ` Christoph Gysin
2005-07-06 16:07         ` Holly Bostick
2005-07-06 16:47           ` Christoph Gysin
2005-07-06 18:22           ` Richard Fish
2005-07-06 18:36             ` Holly Bostick
2005-07-06 19:12               ` Richard Fish
2005-07-06 19:42                 ` Holly Bostick
2005-07-06 20:28                   ` John J. Foster
2005-07-06 20:52                   ` Manuel McLure
2005-07-06 19:13               ` Christoph Gysin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42CBE9D1.5050203@planet.nl \
    --to=motub@planet.nl \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox