Subject: Re: changing password using sudo and su....
To: Timothy A. Musson <timothy.musson@zin-tech.com>
From: None <tripledes@eslack.org>
List: tech-security
Date: 04/01/2004 02:56:18
> At 07:08 PM 3/30/04 , Jeremy C. Reed wrote:
>>On Tue, 30 Mar 2004, Sergio Jimenez wrote:
>>
>>> root@bender# id
>>> uid=0(root) gid=0(wheel)
> groups=0(wheel),2(kmem),3(sys),4(tty),5(operator),20(staff),31(guest)
>>>
>>> root@bender# passwd
>>> Changing local password for sergio.
>>
>>> Anyone could explain what's going on here?
>>
>>passwd(1) uses getlogin(2).
>>
>
> So would "su -" work in the way he was expecting?
>
> -Tim
>
>

If I've understood correctly, it must work in the same way as I told with
"sudo", because "passwd" is using getlogin(2) anyway.

I was trying this situation on Linux/FreeBSD-5/OpenBSD and only OpenBSD
works as NetBSD, and I have to suppose that's because Linux and FreeBSD-5
are PAMized, and Net/OpenBSD aren't.

My question came just for curiosity, because I didn't expect this behavior.

Cheers,
Sergio