[clug] chpasswd gone..

Tony Breeds tony at bakeyournoodle.com
Mon Dec 14 17:42:46 MST 2009


On Tue, Dec 15, 2009 at 11:20:40AM +1100, Andrew Janke wrote:
> Anyone happen to know where this is gone on later versions of
> Ubuntu/Debian?  The new version seems to be very stripped down and
> devoid of function for md5/encrypted passwords.
> 
> Previously I could do something like this:
> 
>    1) copy appropriate shadow lines from some other machine:
> 
>    2) chpasswd --encrypted < modded-shadow-file
> 
> Or is there a "better way" to update a bunch of passwords?  (No, I
> can't/dont want to play NIS/LDAP).

If you have the plaintext you can use the --stdin on pwsswd, if not then
just use sed -i- -s 's/^\(uname)\)<old crypt string>/\1<new crypt string>/'
on shadow, taking the "locks" on either side of the sed

Yours Tony


More information about the linux mailing list