User Tools

Site Tools


Creating local users manually

This guide addresses how to add new users to Dokuwiki manually without existing administrator credentials nor access to the web administrator interface. This document was written for Fedora Linux 30, so the commands and paths below may differ for your distribution.

Setting up a local instance

It'd take much to long to learn PHP and put a script together for this, so using a local Dokuwiki instance will have to do.

  1. Install Dokuwiki with 'sudo dnf install dokuwiki' (use your distro's package manager)

Now we need to enable authentication and add an administrator.

  1. Open '/etc/dokuwiki/local.php' with a text editor
  2. Uncomment the '$conf['useacl']' and '$conf['superuser']' lines
  3. Set '$conf['useacl']' to '1'
  4. Set '$conf['superuser']' to 'admin'

Authentication is enabled for the user 'admin'. Now we need to add that user.

  1. Open '/etc/dokuwiki/users.auth.php' with a text editor
  2. Append the following line to the file:

That line will add the user 'admin' with the password 'admin' to both the 'admin' and 'user' groups. All that's left is to start the web server.

  1. Start httpd with 'sudo systemctl start httpd'

Dokuwiki should start and be accessible at http://localhost/dokuwiki/.

Generating new credentials

Generating new credentials is quite easy.

  1. Open up Dokuwiki in a browser.
  2. Click 'Log in' on the top-right of the page
  3. Enter 'admin' as the username and password and click 'Log In'
  4. Click 'Admin' on the top-right of the page
  5. Click 'User Manager'
  6. Scroll to the 'Add User' section, enter the desired user details, and click 'Add'

If all goes well, the new user will be created and stored on disk. You can confirm their details in the 'User List' section above.

Transferring credentials

The newly-created credentials will be stored as a single line of text within the configuration directory.

On the local wiki:

  1. Open '/etc/dokuwiki/users.auth.php' with a text editor
  2. Find the line starting with the username of the newly-created user

This is the credential line that you will need to transfer to the production wiki. Copy it, email it, write it down, encode into DTMF tones, send via smoke signal, whatever works.

On the production wiki:

  1. Open '/etc/dokuwiki/users.auth.php' with a text editor
  2. Append the credential line to the file

The new user should now be able to log in to the production wiki with the username and password set in step 6 of the previous section.

wiki/adding-users.txt · Last modified: 22/07/2019 22:01 by Thomas Wade