Page tree
Skip to end of metadata
Go to start of metadata

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

    ..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.

If none of these steps worked for you, it's time to poke around in the database

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

    $ python -c 'from passlib.hash import atlassian_pbkdf2_sha1; print(atlassian_pbkdf2_sha1.encrypt("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:

    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:

    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.

1 Comment

  1. Ugh, go away evil spammer!