[clug] chpasswd gone..

Andrew Janke a.janke at gmail.com
Wed Dec 16 16:46:58 MST 2009

>> Previously I could do something like this:
>>    1) copy appropriate shadow lines from some other machine:
>>    2) chpasswd --encrypted < modded-shadow-file
> 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

Thanks all, given that I don't know the previous entry (well I could
get it but that seems like too much work.. :) and I was using a perl
script anyhow I went for a home-baked split/chomp hack type version.

Andrew Janke
(a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia    +61 (402) 700 883

More information about the linux mailing list