On Wed, 15 Jul 2015 14:51:00 +0200, Alex Greif wrote:

> when I 'sudo su - ' into a root shell and issue a 'passwd' without a 
> username
> argument, then it does not try to change the passwd for the current user (in
> this case root) but for the user from which I issued the 'sudo'.

This is because passwd changes the password for the logged in user
by default, as returned by the logname system call.  You can run
the logname command to see that this is not changed when you run
su.

It's probably worth mentioning this in the passwd manual as it does
seem to cause some confusion.

 - todd

Reply via email to