Set pre-encrypted passwords for users

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Wed Mar 31 12:52:55 CEST 2010


On Wed, 31 Mar 2010, Mathias Friman wrote:

> I use some old scripts to create users on a FAI-install system. In
> them I run the 30-demo script from simple examples:
>
> $ROOTCMD adduser --disabled-login --gecos "fai demo user" demo
> echo "demo:$ROOTPW" | $ROOTCMD chpasswd --encrypted
>
> Since Ubuntu 9.10 the chpasswd command does not accept the
> --encrypted switch anymore, so it is impossible to supply a
> pre-encrypted password that way.
>
> Is there any other way to do this and still not write the password
> in clear text?

I know of /usr/bin/mkpasswd (package: whois, on a debian dist) you
could look into:

$ mkpasswd -m help
Available methods:
des     standard 56 bit DES-based crypt(3)
md5     MD5
sha-256 SHA-256
sha-512 SHA-512

that supports input from stdin or another arbitrary fd (see man page).


Cheers,

-- 
Cristian


More information about the linux-fai mailing list