Weblogic Server: Resetting the domain server admin password


Oh SNAP! I have forgotten my Admin Server password for the organisations WebLogic domain.
  • Have you ever forgot the password of WebLogic domain? 
  • Have you been in a situation when you took over administration of the server and discovered the wrong password was handed over to you by the previous administrator who is no longer accessible?
These are recurring issues experienced by Administrators. Additionally, password change can be regularly enforced by the organisations security policy forcing the admin to perform this task frequently
So how do you go about achieving this?
In this post I will be discussing how to reset the WebLogic password. This tutorial will focus on achieving this through the command line.

This post will particularly focus on Windows.
Click here to see the tutorial on Unix

Step 1: Navigate to your preferred Domain
In this post I will be using the domain called "base_domain" in the following directory stated below:

C:\Oracle\Middleware\user_projects\domains\base_domain>


Step 2 : Set the Domain Environment
Change directory to to the bin directory and run the setDomainEnv.cmd script as seen below
C:\Oracle\Middleware\user_projects\domains\base_domain>cd bin
C:\Oracle\Middleware\user_projects\domains\base_domain\bin>setDomainEnv.cmd

Step 3: Navigate to Security Directory and rename the DefaultAuthenticatorInit.ldift file
C:\Oracle\Middleware\user_projects\domains\base_domain>cd security
C:\Oracle\Middleware\user_projects\domains\base_domain\security

in this folder there are the following files:
DefaultAuthenticatorInit.ldift
DefaultRoleMapperInit.ldift
SerializedSystemIni.dat
XACMLRoleMapperInit.ldift

We will be renaming the DefaultAuthenticatorInit.ldift file.(renaming it is a form of backup as the system will recreate a new file in the process of resetting the password)
I will be renaming my file to DefaultAuthenticatorInit_bkp.ldift

Run the following command 
C:\Oracle\Middleware\user_projects\domains\base_domain\security>rename DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit_bkp.ldift

Step 5 : Execute the below command :

C:\Oracle\Middleware\user_projects\domains\base_domai\security> java weblogic.security.utils.AdminAccount weblogic tayo12345 .

The DOT (.) at the end of the command, notifies that it will reset the password in current directory, the above command will re-create the file DefaultAuthenticatorInit.ldift as seen in the directory below.

Step 6 :  Go to Security Folder of Admin Server
At this stage we will now go to the boot properties and modify the password in plain text.
In the command prompt go to the boot.properties file its in the follwoing location:
C:\Oracle\Middleware\user_projects\domains\base_domain\servers\AdminServer\security\boot.properties
Edit the boot.properties file as below and save it.
username=weblogic
password=tayo12345

When weblogic is started it will re-hash the plain text.

Step 7. Navigate to following Directory and Rename LDAP Directory 
As earlier said the essence of renaming these directory is just to serve as a backup if the whole process should fail. During weblogic startup a new LDAP directory will be recreated.

Step 8 :Restart the Server.
Use the folowong script below:
C:\Oracle\Middleware\user_projects\domains\base_domain\bin>startWebLogic.cmd



Step 9: Login to Weblogic server using the url 
http://:7001/console


Thank you for viewing this post. I hope it was helpful

Comments

Popular posts from this blog

Auditing Virtualization

How to Identify if the capacity of your FLASH storage device is genuine or counterfeit

Address Resolution Protocol (ARP): Understanding the basics