I want to automate slappasswd, but the following does not work:[root@controller ~]# echo -e vagrant\nvagrant\n | slappasswdNew password:while it works to automate passwd:[root@controller ~]# echo -e vagrant\nvagrant\n | passwd vagrantChanging password for user vagrant.New password: BAD PASSWORD: The password is shorter than 8 charactersRetype new password: passwd: all authentication tokens updated successfully.QuestionsWhy does this method not work to automate slappasswd?How to automate slappasswd?
Automate slappasswd
centos;slappasswd
According to this manpage you canprovide the password as an argument:slappasswd -s vagrantOtherwise slappasswd reads from the tty and not stdin to get a newpassword. You can use something like expect to talk to it in this case.