in reply to shadow passwd

first of all check if your system is using crypt() or MD5 passwords (RedHat 6..7 uses MD5) if your system uses MD5 passwords then you have to encrypt them with something like that:
use Crypt::PasswdMD5; sub my_md5_crypt { my $salt; for(0..7) { $salt .= ('.', '/', 0..9, 'A'..'Z','a'..'z')[rand 64]; } my $pass = shift; #clear text password return unix_md5_crypt($pass, '$1$' . $salt . '$'); }
in any case you should build a file in this format:
USERNAME:ENCRYPTEDPASSWORD USERNAME2:ENCRYPTEDPASSWORD2 ...
and then
cat THATFILE | /usr/sbin/chpasswd -e
Note: if you have normal crypt passwords just build a file like that:
USERNAME1:CLEARTEXTPASS_1 ...
and then "/usr/sbin/chpasswd < THATFILE"

Replies are listed 'Best First'.
RE: Re: shadow passwd
by merlyn (Sage) on Oct 26, 2000 at 17:08 UTC
RE: Re: shadow passwd
by Anonymous Monk on Oct 26, 2000 at 16:42 UTC
    Thanks for that speedy response. Fantastic! I hope I may be able to return the help one day :-) Steve