Subject: Re: changing password using sudo and su....
To: Timothy A. Musson <timothy.musson@zin-tech.com>
From: Brett Lymn <blymn@baesystems.com.au>
List: tech-security
Date: 04/01/2004 10:19:32
On Wed, Mar 31, 2004 at 11:35:01AM -0500, Timothy A. Musson wrote:
> 
> So would "su -" work in the way he was expecting?
> 

No.  "su -" just dumps the environment and sources the new one.

The passwd command gets the login id of the terminal being used (that
is what getlogin(2) does).  This is probably more clear if you try a
"id -p".  If you want to change the passwd of root when su'ed then use
"passwd root", that will do the right thing.

-- 
Brett Lymn