Subject: Re: changing root's password changes login user instead
To: Jeremy C. Reed <>
From: Thor Lancelot Simon <>
List: tech-userlevel
Date: 05/04/2007 14:54:01
On Fri, May 04, 2007 at 01:28:55PM -0500, Jeremy C. Reed wrote:
> On NetBSD, logging in as a non-root user and then "su" to root followed 
> by "passwd" will reset the original logged in user's password.

Of course it does -- it you want the system to behave as if you logged
in as root, use 'su - root'.  Otherwise, you get root's uid with your own
login environment -- which is what Unix su has done for as long as I can
remember, anyway.  "Unix gives you enough rope."

I believe you can also change the behavior of passwd by changing the
value of the $USER or $LOGNAME environment variables.