User Tools

Site Tools


how-to-reset-doku-wiki-password-by-ssh

Email based password reset not working for you? Assuming you have ssh access, you can still reset lost DokuWiki passwords by following the instructions below.

  1. First, open up an SSH session to your doku wiki host
  2. Navigate to your DokuWiki app's htdocs folder
  3. Open up an interactive php REPL with php -a
  4. Once in the REPL, enter the following commands:

    require_once 'lib/PassHash.class.php';
    $ph = new PassHash();
    echo $ph->hash_smd5('your password goes here');

    Note that the last command assumes your DokuWiki setup is using salted MD5 for password hashes, per its default behaviour. Depending on what's stored in the passcrypt setting in your main DokuWiki configuration file, however, you might need to use a different hashing function.

  5. You should end up with a hash that looks something like this: $1$E52ZFnaC$LfmrxdHick7.bsTlIijKy1
  6. Copy the hash DokuWiki provided to the clipboard, then navigate to the conf subfolder (cd conf) and edit the users.auth.php file using your tool of choice (vim, emacs, nano, etc.). It might be a good idea to back it up first, but what can I say, I live life on the edge.
  7. Replace the password hash of your forgotten password with the new hash you generated. That should be it!
how-to-reset-doku-wiki-password-by-ssh.txt · Last modified: 2018/01/14 14:18 by textninja

Bitnami