sudo does not work

nina zarina at mimos.my
Wed Sep 18 03:38:27 EDT 2002


I see ... okay ... it works with pine when I use the -H option. Thanks a
lot,
but it still got the same error when trying to use vi or pico.  Does anybody
know
what else do i need to set for these to work?

thanx
Zarina

----- Original Message -----
From: Matthew Hannigan <mlh at zip.com.au>
To: nina <zarina at mimos.my>
Cc: <sudo-users at sudo.ws>
Sent: Wednesday, September 18, 2002 1:31 PM
Subject: Re: sudo does not work


> On Wed, Sep 18, 2002 at 12:16:01PM +0800, nina wrote:
> > Hi,
> > I'm currently exploring how to use sudo.  I already installed &
configured, but could not get something right.  What I wanted to do was sudo
to let's say newuser and open pine as newuser.
> >
> > as olduser, i typed this command
> >                       sudo -u newuser pine
> > it asks for the olduser password(ok), then I got an error saying that i
cannot open ~olduser/mail because of permission denied.
> > I thought I was supposed to open newuser's mailbox? Then why is it
trying to open the olduser's mailbox? Is my understanding of how sudi should
work correct?
> >
> > I think my configuration in sudoers file is already correct, the entry
is as below :
> > olduser ALL = (newuser) /usr/local/bin/pine
>
> This is because pine uses environment variables
> find things, and sudo doesn't necessarily overwrite
> or remove environment variables.
>
> It's not just pine, of course many programs work like this.
> The particular variable is probably HOME or MAIL or
> something like that.
>
> sudo really only changes id; it doesn't set up the
> environment necessarily.  It does remove some dangerous
> env vars; see the FAQ.
>
> Solution?  Use the -H flag (set HOME); or if that doesn't
> work, make the sudoers entry:
>
> olduser ALL = su - newuser /usr/local/bin/pine
>
> and invoke
> sudo su - newuser /usr/local/bin/pine
>
> which will do a 'proper' login
>
> Regards,
> Matt
>
>




More information about the sudo-users mailing list