jump to navigation

How to hide the passwords in shell script December 1, 2015

Posted by sendtoshailesh in Uncategorized.
Tags: , ,
trackback

How to hide the password in shell script say for example you want to hide the password from Oracle RMAN backup script. Then on Linux platform this can done using openssl command as follows:

 

Below script to be ready for one time use whenever you change the password.
read -s -p “Enter Password :- ” _PAS
echo “$_PAS”|openssl enc -base64 > encrypted_passwd

 
unix shell scripts where rman backup is coded should be added with following code. Most probably this will placed just before script connect to rman

syspwd=`cat encrypted_passwd|openssl enc -base64 -d`
rman target sys/${syspwd}@service

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: