Followers

Tuesday, July 16, 2019

Mamun's DBA Blog: Reset weblogic server admin user password

Reset WebLogic User Password: Action Plan-1
-------------------------------------------------------
1. Make sure all the services are down

2. change directory to /u01/app/middleware/user_projects/domains/bifoundation_domain/bin

cd /u01/app/middleware/user_projects/domains/bifoundation_domain/bin

3. Source the setDomainEnv.sh (Linux)/setDomainEnv.cmd(Windows)  script so we can get all the WebLogic variables set correctly

In Linux:  . /setDomainEnv.sh

In windows: setDomainEnv.cmd

4. Now change the directory to security directory in your instance.

cd /u01/app/middleware/user_projects/domains/bifoundation_domain/security

5. Move the DefaultAuthenticatorInit.ldift to a backup file

In Linux:

mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit_old.ldift

In Windows:

mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit_old.ldift

6. Run the “java weblogic.security.utils.AdminAccount  newuser  newpassword .” to generate a new DefaultAuthenticatorInit.ldift with a new user with the assigned password within the security directory

eg:
java weblogic.security.utils.AdminAccount weblogic weblogic123 .

Note: Replace newuser and newpassword with a user and password of your choosing. Ensure the password is a minimum of 8 characters and contains at least one numeric character.
Also, don’t forget the period “.” at the end of the above command, it is required.


7. Change directory to /u01/app/middleware/user_projects/domains/bifoundation_domain/servers/AdminServer/security

cd /u01/app/middleware/user_projects/domains/bifoundation_domain/servers/AdminServer/security/

8. Edit the boot.properties file and replace newpassword and newusername with the user and password you defined in step 6.
Do this for all the servers in the domain.

vi boot.properties

username=weblogic
password=newpassword

The boot.properties will get encrypted once the admin server starts up

9. Rename or remove directory /u01/app/middleware/user_projects/domains/bifoundation_domain/servers/AdminServer/data/ldap
as it will get recreated once the WebLogic Admin server starts.

e.g:
cd /u01/app/middleware/user_projects/domains/bifoundation_domain/servers/AdminServer/data/

mv ldap ldap_date

10. Change directory to /u01/app/middleware/user_projects/domains/bifoundation_domain/bin and start the Weblogic Admin Server

cd  /u01/app/middleware/user_projects/domains/bifoundation_domain/bin

In Linux:  ./startWebLogic.sh

In Windows: startWebLogic.cmd

11. Use new credentials to startup in startup command.Once the weblogic server is up, you’ll be able to login to Console with the new weblogic Admin user and password.

===================================================================
Reset WebLogic User Password: Action Plan-2
-------------------------------------------------------
Please try the below actionplan to change the weblogic admin password:

--> Firstly Shut down the WebLogic domain--> the managed servers, Admin Server and Node Manager.

--> Rename the data folder under the AdminServer of the domain to old_data, this is the path: %DOMAIN_HOME%/servers/AdminServer/data

--> In the same command prompt that you opened earlier, set the environment variable of the domain by calling: %DOMAIN_HOME%/bin/ --> ./setDomainEnv.sh

--> In the same command prompt, change directory to security folder: cd %DOMAIN_HOME%/security

-->Inside the %DOMAIN_HOME%/security directory, move the file "DefaultAuthenticatorInit.ldift" to "%DOMAIN_HOME%/security/old/"

--> In the next step, the command that we are going to run will create a new file “DefaultAuthenticatorInit.ldift” in the security folder

-->Run the following command to reset or change admin password:
java weblogic.security.utils.AdminAccount weblogic password .

NOTE: The DOT at the end of the above command represents the current directory. A new "DefaultAuthenticatorInit.ldift" file will be created in the current directory
when you execute the command.

--> Update the "boot.properties" file under the directory %DOMAIN_HOME%/servers/AdminServer/security/ with your username and the new password.

--> Now start the admin server using the new credentials from %DOMAIN_HOME%/bin/ --> ./startWeblogic.sh

Once the AdminServer started, login into the Admin console using the username and the new password.

No comments:

Post a Comment