Tuesday, April 22, 2008

Great Tips for Protecting Oracle Listener!!

In this article we will discuss some great tips that will help you protect your listener by setting password on it. This will help you prevent unintentional stopping of your listener and prevent illicit access to your listener.
Adding Oracle Cleartext Password:
If you set the password manually in listener.ora using the PASSWORDS_ parameter then your password will be stored in cleartext. You can add below entry in your existing listener.ora file.
PASSWORDS_MYLISTENER = (myPswrdVar1)
After that you will stop the listener by running below command and then restart it.
LSNRCTL> SET PASSWORD PASSWORD: LSNRCTL> STOP LSNRCTL> START

Adding Oracle Encrypted Password:
In order to add Oracle encrypted password you should set the password using LSNRCTL. LSNRCTL will encrypt the password stored in listener.ora.
LSNRCTL> SET CURRENT_LISTENER LSNRCTL> SET SAVE_CONFIG_ON_STOP ON LSNRCTL> CHANGE_PASSWORD
Old password: New password: Reenter new password: <>
LSNRCTL> SET PASSWORD PASSWORD: LSNRCTL> SAVE_CONFIG
The passwords you entered will not be echoed. Now if you check your listener.ora file then you will see a new parameter as PASSWORDS_ .
Now you will stop the listener by running below command.
LSNRCTL> SET PASSWORD PASSWORD: LSNRCTL> STOP LSNRCTL> START
Now if you check your listener.ora file then you will see new entries as follows
SAVE_CONFIG_ON_STOP_MYLISTENER = ON PASSWORDS_LISTENER = 2D6C48144CF753AC
If cleartext password is set for your listener then first you will be required to comment out the line PASSWORD_ in your listener.ora file, then restart listener and finally run above LSNRCTL commands.
You can use the PASSWORDS_listener_name parameter to store an encrypted password for a listener. This will make sure that the privileges operations like SAVE_CONFIG and STOP are secure.
PASSWORDS_MYLISTENER = (myPswrdVar1)
Password protecting Listener with forgot password:
If you have forgotten your listener password then first you will need to log in to operating system and kill the listener password process from your operating system. Then you will have to modify the PASSWORDS_LISTENER parameter in the listener.ora file and restart your listener. Finally you can use any of the above methods to set up password protection of your listener. Read Again!!
Note: It is recommended not to run any code portion directly on your production system.

No comments: