Monday, 24 August 2020

Node Manager Username and Password for Oracle HTTP Server 12c

 


How to Change the Node Manager Username and Password for Oracle HTTP Server 12c in a Standalone Domain (Doc ID 1945039.1)

Applies to:

Oracle HTTP Server - Version 12.1.2.0.0 and later
Information in this document applies to any platform.

Goal

What tools can be used to modify the node manager user name and password for a standalone OHS 12c domain?  

Note:  A standalone domain is a container for system components, such as Oracle HTTP Server. It has a directory structure similar to an Oracle WebLogic Server Domain, but it does not contain an Administration Server or Managed Servers. It can contain one or more instances of system components of the same type, such as Oracle HTTP Server, or a mix of system component types.  Reference 1.4.2 Standalone Domain

 

Solution

The steps are as follows:

1. Stop the Oracle HTTP Server component and the Node Manager (NM) :

$ cd DOMAIN_HOME/bin
$ ./stopComponent.sh <ohs_component>

$ ./stopComponent.sh <ohs_component>
Stopping System Component <ohs_component> ...

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Reading domain from DOMAIN_HOME
 
Please enter your password : <Enter old password>
Connecting to Node Manager ...
Successfully Connected to Node Manager.
Killing server <ohs_component> ...
Successfully killed server <ohs_component>
Successfully disconnected from Node Manager.

Exiting WebLogic Scripting Tool.

Done
$

CTRL C in the window where NM is running (Or kill the PID of NM)


2. Invoke WLST offline:

$ cd ORACLE_HOME/oracle_common/common/bin
$ ./wlst.sh

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline>

3. Read in the domain:

wls:/offline>readDomain('DOMAIN_HOME')

4. Get the security MBean:

wls:/offline/ohs_domain>cd('/SecurityConfiguration/ohs_domain')

5. Change the NM user name:
Need to provide a node manager user name on this step, this can be an old user name. Otherwise, the NM password may not modify correctly.

wls:/offline/new_ohs_domain/SecurityConfiguration/new_ohs_domain>set('NodeManagerUsername','<new_NM_Username>')

6. Change the NM password then commit the changes. You can give a clear text password such as 'welcome1'.
The encrypted password will be stored in /u01/oracle/config/ohs_domain/nodemanager/nm_password.properties.

wls:/offline/new_ohs_domain/SecurityConfiguration/new_ohs_domain>set('NodeManagerPasswordEncrypted','password')
wls:/offline/new_ohs_domain/SecurityConfiguration/new_ohs_domain>updateDomain()
wls:/offline/new_ohs_domain/SecurityConfiguration/new_ohs_domain>closeDomain()
wls:/offline>exit()

Exiting WebLogic Scripting Tool.


Checking timestamps you can see that  the following files have been updated:

/u01/oracle/config/ohs_domain/config/config.xml
/u01/oracle/config/ohs_domain/config/nodemanager/nm_password.properties

7. Restart NM:

$ cd DOMAIN_HOME/bin
$ ./startNodeManager.sh

8. Finally, restart OHS

$ ./startComponent.sh <ohs_component>
Starting System Component <ohs_component> ...

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Reading domain from DOMAIN_HOME
 
Please enter your password : <Enter new password>
Connecting to Node Manager ...
Successfully Connected to Node Manager.
Starting server <ohs_component> ...
Successfully started server <ohs_component> ...
Successfully disconnected from Node Manager.

Exiting WebLogic Scripting Tool.

Done


9. It is possible to prevent the prompt for the NM password on each OHS startup by storing the password in an encrypted form using a key store with the command:

$ ./startComponent.sh <ohs_component> storeUserConfig

10. If the old password was previously stored in a key store before the password was changed, the cached key store files need to be removed before restarting the OHS component:

$ cd
$ cd .wlst
$ ls -l
total 8
-rw-r----- 1 user group 227 Nov 14 16:09 nm-cfg-ohs_domain.props
-rw-r----- 1 user group 64 Nov 14 16:09 nm-key-ohs_domain.props
$ rm nm-cfg-ohs_domain.props
$ rm nm-key-ohs_domain.props


11. If required, the new password can then be re-stored using the same command:

$ ./startComponent.sh <ohs_component> storeUserConfig
To BottomTo Bottom

No comments:

Post a Comment