OHS 12c: How to Change the Node Manager Username and Password for Oracle HTTP Server 12c in a Standalone Domain:
Solution:
Step 1: Stop the Oracle HTTP Server component and the Node Manager (NM) :
$ cd DOMAIN_HOME/bin
$ ./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
Step 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>
Step 3: Read in the domain:
wls:/offline>readDomain('DOMAIN_HOME')
Step 4: Get the security MBean:
wls:/offline/ohs_domain>cd('/SecurityConfiguration/ohs_domain')
Step 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>')
Step 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.
Step 7: 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
Step 8: Restart NM:
$ cd DOMAIN_HOME/bin
$ ./startNodeManager.sh
Step 9: Finally, Start 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