www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/14/14:12:17

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4AADFEF1.40901@alice.it>
References: <4AADFEF1 DOT 40901 AT alice DOT it>
Date: Mon, 14 Sep 2009 14:12:04 -0400
Message-ID: <17393e3e0909141112x6f29bf80he21e49649b462ed2@mail.gmail.com>
Subject: Re: Reading what should not!
From: Matt Wozniski <godlygeek AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mon, Sep 14, 2009 at 4:29 AM, Angelo Graziosi wrote:
> Larry Hall (Cygwin) wrote:
>>
>> This is new behavior with 1.7 and it's there to mimic what one sees in
>> Linux. =C2=A0I can't reproduce your reported results in Fedora 8. =C2=A0=
For me, if I
>> am 'root', I can see the contents of 'foo.txt' just fine with the
>> permissions
>> you have set on it.
>
> I do not know how Fedora works, but on Kubuntu the user created when
> installing the SO is also 'root': one need only to use 'sudo...'.

sudo allows non-root users to run commands as root, or to get shells as roo=
t.

> After typing the password it 'remains active' =C2=A0for about 15 minute.

"remains active" meaning that the sudo infrastructure remembers that
you have validated yourself to it already, and don't need to do it
again.

> This mean that
> if I use 'sudo less foo.txt' when that pass. is active I do not need to
> retype it, and, as 'root', I can read that file.

You don't need to retype it because sudo remembers that you've typed
it already, so lets you become root anyway.  You can read the file
because you're root - that has nothing to do with the password.  The
password only affects the steps where you're gaining root privileges,
it has nothing to do with what you can do once you have them.

> But if I open a new shell,
> in which the passwd is not yet 'active', trying 'sudo less...' asks for t=
he
> passwd, which looks right to me.

The sudo password caching can be disabled entirely, enabled per-user,
or enabled per-tty (basically per-shell).  sudo can also be configured
to either require the password of the user or the password of root to
launch commands as root.

> Why 'root' should read, for example, private mails of the other simple us=
ers
> of that PC?

As Dave Korn said, because he needs to be able to.

You're confusing the process of *becoming* root with what root can do.
 Becoming root requires a password, of course!  On a system where you
become root using sudo, that password is usually the user's password,
but it can also be root's password, depending on the system's config.
But once you've become root, you can do whatever you want, including
deleting every file and directory on the disk, and no one can stop
you.

To prove that the "password becoming active" is just part of the inner
workings of sudo, you could just try out "sudo -i" to get an
interactive shell as root - you'll see that you can "less" the file
just fine, and will continue to be able to for as long as you stay
logged in as root.

~Matt

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019