0

I'm automating the process of creating WordPress sites with a custom shell script. Is it possible to encrypt MYSQL passwords with BCrypt for WordPress? If so, what's the best way to approach this?

Snippet:

#!/bin/bash

execute="
CREATE DATABASE IF NOT EXISTS $dbName;
GRANT SELECT, INSERT, UPDATE, DELETE
  ON $dbName.*
  TO '$dbUser'@'localhost' IDENTIFIED BY '$dbPass';
FLUSH PRIVILEGES;
"

mysql -uroot -p --show-warnings -e "$execute"

With Ruby, I can encrypt it like so:

encryptedPass="$(ruby -e "require'bcrypt';puts BCrypt::Password.create('$dbPass')")"
4

1 回答 1

0

编写您自己的 WordPress 插件以使用 BCrypt 转换哈希值。此外,如果您打算走这条路,请务必彻底审核您的代码。我已经包含了两个链接,它们帮助我开始了这条道路,我希望它们可以帮助任何有兴趣加强他们的设置的人。

于 2015-04-02T23:21:28.303 回答