I have a -p[assword] option to a script which creates user accounts in non-interactive mode. If this option is passed then the script will generate a random password (saving the info to a 400 perm file owned by root) and automatically set the password.
Is there a way to pass the randomly generated password into the stdin of the passwd command? I tried the usual "<<EOF" and echoing the input via a pipe but can't get it to work.
Any ideas?
Is there a way to pass the randomly generated password into the stdin of the passwd command? I tried the usual "<<EOF" and echoing the input via a pipe but can't get it to work.
Any ideas?