2021年8月6日 星期五

重置 Drupal 使用者密碼

 在 Drupal的安裝目錄內,scripts目錄下,找到password-hash.sh這支程式,執行

php 路徑/password-hash.sh '新密碼' > newpassword.txt

用 Hash 產生的 的密碼,會寫入 newpassword.txt,打開 newpassword.txt 即可看到如下內容:

password: '新密碼'

hash: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

將hash密碼,直接利用資料庫工具,貼入使用者的 密碼 欄位 即可!