How can I reset a forgotten admin password in Nexus Repository 2?

Visit for documentation on Nexus Repository version 2.

If you had the user's email address set properly (and the smtp configuration set properly), you could click login in the UI and select forgot password, enter the username and email address, and a new password will be sent to you. If you do not have email setup properly, you will need to manually edit the security.xml file, located in (nexus-basedir)/../sonatype-work/nexus/conf/security.xml.

  1. Stop Nexus Repository 2
  2. Edit (nexus-basedir)/../sonatype-work/nexus/conf/security.xml
  3.  find the <user> object that has a <id> of admin
  4. change the <password> to
  5. Make sure the user has an active status: 


  6. Save the file and start Nexus Repository 2

This will give the admin user a password of admin123 (the default) and you will again be able to log in as admin user with the password admin123.

Note: The above applies to Nexus Repository 2.4 and earlier. For Nexus Repository 2.5 and later the admin123 password hash is:


Note: In order for this to work the XML security realm must be installed.  It likely is, since it ships by default, but sometimes people remove it.  If you're still having trouble check "sonatype-work/nexus/conf/security-configuration.xml" and make sure the realms list has the following two lines:

Have more questions? Submit a request


  • 0
    Permanently deleted user

    This is very useful for us! Thanks!

  • 0


  • 0

    How do i do this with Nexus 3.0 Milestone 7 release.

    don't see a security.xml anymore

  • 0
    Rich Seddon

    For now contact support for help with 3.0m7 and resetting the admin password.

  • 0

    thanks for the answer, i guess i can have it just re-installed instead for now.

  • 0
    Peter Lynch

    We are closing this article for comments.

    If you have a support license, please contact us by submitting a support ticket.

    If you do not have a support license, please use our Nexus Users List or our other free support resources.

Article is closed for comments.