- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to encrypt password within scripts
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 09:59 PM
09-07-2005 09:59 PM
I have a database script that contains system password within it. How can i encrypt the password with any other character.
Similarly, is there a way the script will prompt me for the password and i can type in the system password, in encrypted format.
And when the backup will be scheduled it will take the encrypted password.
Please advice us,
AJi
Please advice me
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 10:05 PM
09-07-2005 10:05 PM
Re: How to encrypt password within scripts
But be sure that the encrypting algorithm of DB is the same of "crypt".
Alex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 10:08 PM
09-07-2005 10:08 PM
SolutionOtherwise, you can not encrypt the pass in a shell file. What you can do is put following code, that will supress, the echo of the password.
trap 'stty echo; exit' 0 1 2 3 15
echo "Enter Password: \c"
stty -echo
read PASSWD
stty echo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 10:56 PM
09-07-2005 10:56 PM
Re: How to encrypt password within scripts
Thanks for the advice,
I want to verify the password matches with the database.
How can i achieve that?
Something like including
sqlplus system/$PASSWD
when i tried to include its shows the output, i want to run this autentication in the background. Please advice me
AJi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 11:10 PM
09-07-2005 11:10 PM
Re: How to encrypt password within scripts
stty -echo
your code for check goes here
some more code
stty echo
Anything between stty -echo and stty echo
will not be displayed to the screen.
You can also do re-directon of std out, std err to /dev/null
"check_statement" > /dev/null 2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 11:15 PM
09-07-2005 11:15 PM
Re: How to encrypt password within scripts
Try:
sqlplus -L user/password > /dev/null 2>&1
echo $?
So, if "$?" is 0, login was ok, if not, login failed. -L option says to try login only once and exit and all the output we redirect to /dev/null.
Alex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2005 03:06 AM
09-08-2005 03:06 AM
Re: How to encrypt password within scripts
Guys, its working fine.
In my script i included as follows,
-------------------------------------------
trap 'stty echo; exit' 0 1 2 3 15
echo "Enter Password: \c"
stty -echo
read PASSWD
sqlplus -L system/$PASSWD@prod <
exit
EOF1
exit_code="$?"
if test "$exit_code" = "1"; then
printf "\nLogin failed\n";
else
printf "\nLogin Success\n";
fi
-------------------------------------
Regards
AJi