Link to home
Start Free TrialLog in
Avatar of Jason Dupont
Jason Dupont

asked on

Knoppix set passwd redirect stdin from file

I am running knoppix kernel 2.6.17 booting from a USB key.  I would like to set a password for the root account from my startup script.

I have created a file called passwdtwice, and run the following: passwd <passwdtwice
The passwdtwice file contains:
test123
test123

However, everytime I run the command it says the passwords do not match.  They do!  I ensured there is a CR after each line too.

Any idea how to make passwd take input from stdin directed from file?  (There is no -stdin option for passwd in this version of knoppix).?

Help!
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jason Dupont
Jason Dupont

ASKER

How do I create the encrypted password (for use with usermod)?
Just change the password with 'passwd' tool, then grab the encoded password from /etc/shadow file