AEM 6 SP2 - Reset Administrator Password to admin offline

Goal


The default password for administrator user admin is admin. If the password was changed to something else, to reset it to admin without logging in...

Thanks to Yuval Ararat for the tip

Solution


1) Stop AEM 6 instance

2) Place the package reset_admin_pass_to_admin.zip in <AEM_Home>/crx-quickstart/install (create it, if there isn't one)

3) Start AEM 6 instance

4) Package should have installed. It contains /home/users/a/admin/.content.xml with rep:password set to text admin encrypted 

5) Login as admin/admin

6 comments:

  1. I tried this and worked without stopping the instance. Thanks Sreekanth

    ReplyDelete
  2. Hi,

    I have tried this on AEM 6.2 with no luck...any help is appreciated.

    Please look into this

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Can you please confirm if it works with AEM.6.2

      Delete
  4. Hello,

    I tried this but get the following error in the log

    18.11.2016 11:43:54.461 *ERROR* [OsgiInstallerImpl] org.apache.jackrabbit.vault.fs.io.AutoSave error during auto save - retrying after refresh...
    18.11.2016 11:43:54.473 *ERROR* [OsgiInstallerImpl] org.apache.jackrabbit.vault.fs.io.Importer Error while committing changes. Aborting.
    18.11.2016 11:43:54.482 *ERROR* [OsgiInstallerImpl] org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage Error during install.
    javax.jcr.nodetype.ConstraintViolationException: OakConstraint0027: The admin user cannot be removed.
    at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:225)
    at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:212)
    at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:594)
    at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:461)
    ...

    What am i doing wrong?

    Stefan Goethals.

    ReplyDelete
  5. For 6.2, you'll need to know the path to the admin user node in the instance you want to change.
    1. Create a package with the admin account with a known password.
    2. Download the package and update the node path and filter.xml to match the account on the target instance.
    3. Upload package to install folder and restart AEM.

    In error.log, you should see "content package installed"

    AEM may refuse to install package because of missing rep:token.key, if this occurs, just make sure you are not including .tokens under the admin node.

    ReplyDelete