Other Help Topics :: setting root passwd for headless system



Sorry, I often cannot keep up with all the posts.

If you wish to use bash to script change a password, you can use /usr/sbin/chpasswd.

Take a look at the example that I did in /etc/init.d/dsl-config.for the boot option "secure":

It is as simple as...

echo "root:$PASSWD|chpasswd"

Perfect :) Though, I had a little more success with
Code Sample
echo "root:$PASSWD"|chpasswd

,just like in the example you pointed to ;)

Exactly how insecure is it to store your root password as plain text in a bash script? I know, bad, I know... But how on earth can anyone get into my machine to read the script in the first place?

Anyways, it works :)


original here.