I posted this under security, though i fear it was the wrong place..
If i had two boxes, i added a user to one and set a password.
I then add the user to the second box using useradd.
How can i take the encrypted password from box 1 for input into box 2 - ideally something i can use in a shell script.
I've tried so far, searching and replacing, but the passwords contain "/$." etc, I've also tried fully replacing the shadow file and cat >> shadow, but this has mixed results usually ending with a blank shadow file.
I can use passwd "user" but this required the typing of the unencrypted password.
I've noticed some of the user creation commands have the ability to take an encrypted password, however i'm struggling with the syntax of this.
Ideally i'd like to be able to take the encrypted data from one box and have a command such as - "command" "user" "encrypted data"
Any thoughts on how i can achieve this?
to simplify the question, is there any way i can take the already encrypted user password from one box and use it to reset the same users password on another box..?