Showing posts with label recreate weblogic user password. Show all posts
Showing posts with label recreate weblogic user password. Show all posts

Monday 9 February 2015

How to recreate/reset weblogic user password

Steps to recreate weblogic superuser (when password of existing user is forgotten)



1.  Shutdown WebLogic Server (If Running) – Optional Step
2.  Login to WebLogic Server and set environment variable
cd $DOMAIN_HOME/bin   (where DOMAIN_HOME is the directory in which your domain exists, default value is $MW_HOME/user_projects/domain/base_domain), and execute the following …
. ./setDomainEnv.sh (Linux/Unix)  -or- setDomainEnv.cmd (Windows)

3. Create an initialization file using the following command. (Note the DOT at end of this command) 
go to the following directory
cd /u01/oracle/middleware/user_projects/domains/ClassicDomain1/
then execute the following command
java weblogic.security.utils.AdminAccount   . 
For Example – (Note the DOT at end of this command):
java weblogic.security.utils.AdminAccount weblogic welcome1 .
This will create file  DefaultAuthenticatorInit.ldift in directory from which you executed this command .

4. Rename the original file DefaultAuthenticatormyrealmInit.ldift in the $DOMAIN_HOME/security/ (for example, rename to ORIG_DefaultAuthenticatormyrealmInit.ldift) and replace it with the new DefaultAuthenticatorInit.ldiftgenerated in step 3

5. Rename the data directory under $DOMAIN_HOME/servers//data (for example, rename it to another directory like data.bak – the data directory contains files related to embedded LDAP and role mapping file).
Perform the above for the Admin Server, that is, where is AdminServer; and then repeat the step for the managed server(s).
Repeat this step for all managed servers which are part of this domain.
Note: This step will remove all existing users/groups from WebLogic’s embedded LDAP server (recreate these users/groups in setp8)

6. Recreate the boot.properites file under $DOMAIN_HOME/servers//security with username and password created in step 3 above.  The contents of the file will be like this …
USERNAME=weblogic
PASSWORD=welcome1
As before, perform the above for the Admin Server, that is, where is AdminServer; and then repeat the step for the managed server(s).
Repeat this step for all managed servers which are part of this domain.

7. Start (or restart) Admin Server and test if you can login to WebLogic Console using the new username and password. Access the WebLogic Console from a URL similar to this: http://:7001/console

8. Recreate any users/groups (which were part of default authenticator prior to new super user creation) or import existing users (from WebLogic’s servers embedded LDAP server backup)
============Another Solution ==============

  • Set up the following environment variables. They are not necessary for the process itself, but will help you navigate. In this case my domain is called "ClassicDomain". Remember to change the value to match your domain.
    export MW_HOME=/u01/app/oracle/middleware
    export DOMAIN_HOME=$MW_HOME/user_projects/domains/ClassicDomain
  • Shut down the WebLogic domain.
    $ $DOMAIN_HOME/bin/stopWebLogic.sh
  • Rename the data folder.
    $ mv $DOMAIN_HOME/servers/AdminServer/data $DOMAIN_HOME/servers/AdminServer/data-old
  • Set the environment variables.
    $ . $DOMAIN_HOME/bin/setDomainEnv.sh
  • Reset the password using the following command. Remember to substitute the appropriate username and password.
    $ cd $DOMAIN_HOME/security
    $ java weblogic.security.utils.AdminAccount   .
  • Update the "$DOMAIN_HOME/servers/AdminServer/security/boot.properties" file with the new username and password. The file format is shown below.
    username=
    password=
  • Start the WebLogic domain.
    $ $DOMAIN_HOME/bin/startWebLogic.sh

Reference: 
https://obieepedia.wordpress.com/2013/03/11/forgot-weblogic-user-password-how-to-reset-the-weblogic-user/