Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


...

Excerpt

...

hiddentrue

This page has instructions for doing a database-level user password reset in JIRA and Confluence (and other Crowd-library-using applications).

There's two things to try before messing with password hashes in the database:

...

  1. Click the 'Can't access your account?' link on the login screen
    Image RemovedImage Added
    ..and wait at least a minute (for the JIRA mail queue to flush). This won't work if your account has a bogus email address, or your JIRA mail server is unconfigured.
  2. Ask another administrator to reset your password via the admin interface. Not an option if you are the only administrator.

...

  1. Compute a hash of a new password. For example:

    Code Block
    $ pythonsudo pip3 install passlib
    $ python3 -c 'from passlib.hash import atlassian_pbkdf2_sha1; print(atlassian_pbkdf2_sha1.encrypthash("hunter2"));'
    {PKCS5S2}sFaqFaJUijGG0FqLUQrhPOEXrxB7jrXI7lzkPstbM3bhPq7x8rSS+Q3NtSduIgwt

    (thanks to https://eikonal.wordpress.com/tag/authenticator/)

  2. Print and save the original password hash somewhere, just in case you need to restore it:

    Code Block
    jira=> select id, user_name, credential from cwd_user where user_name='admin';
    ┌───────┬───────────┬───────────────────────────────────────────────────────────────────────────┐
    │  id   │ user_name │                                credential                                 │
    ├───────┼───────────┼───────────────────────────────────────────────────────────────────────────┤
    │ 10000 │ admin     │ {PKCS5S2}Ba+7BCXolbe7oFyBuSISlh9ayhodhmqpXpYMNw5/Ky7YlHIbnDp+qgRuv4vqGrE6 │
    └───────┴───────────┴───────────────────────────────────────────────────────────────────────────┘
    (1 row)


  3. Set the new password:

    Code Block
    jira=> update cwd_user set credential='{PKCS5S2}sFaqFaJUijGG0FqLUQrhPOEXrxB7jrXI7lzkPstbM3bhPq7x8rSS+Q3NtSduIgwt' where user_name='admin' returning credential;
    ┌───────────────────────────────────────────────────────────────────────────┐
    │                                credential                                 │
    ├───────────────────────────────────────────────────────────────────────────┤
    │ {PKCS5S2}sFaqFaJUijGG0FqLUQrhPOEXrxB7jrXI7lzkPstbM3bhPq7x8rSS+Q3NtSduIgwt │
    └───────────────────────────────────────────────────────────────────────────┘
    (1 row)
    UPDATE 1


  4. Restart JIRA.