How to encrypt password

Henning Glawe glaweh at physik.fu-berlin.de
Mon Apr 7 15:09:34 CEST 2008


On Mon, Apr 07, 2008 at 02:54:49PM +0200, Walter den Besten wrote:
> I want to use the same way to define a password for an  other local  
> user which should exist on all our servers.
> However, I can't find the way to translate "fai" to something like  
> "$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1"
> 
> Could someone tell me how?

this is an MD5 hash; there are several ways to generate it:

1) change the password of a user to the password and copy the hash from
	/etc/shadow

2) in a script, you can e.g. use the grub shell:

[...]
MD5=`/usr/sbin/grub --batch --device-map=/dev/null <<EOF \
    | grep "^Encrypted: " | sed 's/^Encrypted: //'
md5crypt
$PASSWD
quit
EOF
`
[...]


-- 
c u
henning


More information about the linux-fai mailing list