LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-08-2006, 06:12 AM   #1
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
Problem with oracle scripts


Hi there

I am not an Oracle DBA,but this problem is concerned with linux also ,so I trying out here.

I am trying to write an oracle script(which will be executed from the Linux shell) which will login into sqlplus and perfom the required operations.

For this I will need to connect to SQLPLUS with oracle installed.
But the problem is that I am not able to get how will I hide the password in that script.

The password will be in clear text which will be easy for anyone to read if acces to that file,I want to encrypt those passwords.

Is there any way out??

regards
 
Old 03-08-2006, 07:15 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
You could try sourcing a different file that contains the password and has some more severe access restrictions (ie only allowing read access to you and root).

To accomplish this:
-setUID bit on your oracle/SQLPLUS script to make it run as your user.
-in that script, source your credentials file, ie (Bash):
. /home/your_user/.credentials_Oracle (if you're root, you can also put it in /etc somewhere).
-In that file (rwx for you only), add lines to set a variable like $password or something.
After sourcing the credentials file, you can use $password in your Oracle script.

The catch here is that you'll need setUID bit to make it work, which implies other security hazards.

An alternative would be to use more advanced security features like PAM or SELinux. But I'm no expert in those matters.

Edit:
A few security notes though:
-don't put setUID on a program owned by root. Use a dedicated user instead if needed.
-make sure no-one has write access on the directory -or any directory above- where the credentials files is located. Preferably, execute permission and/or read permission on any directory leading up to the credentials file should be denied to anybody else but your user (that's why you can put it in a home directory - those usually have limited permissions already).

Last edited by timmeke; 03-08-2006 at 07:19 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xhost + as user oracle not working, need to see oracle install GUI enzo250gto Linux - Software 2 02-11-2007 11:27 AM
start|stop multiple oracle databases in the same oracle server prozac Linux - Software 8 01-23-2007 03:01 AM
Changing Oracle user password will affect oracle db? sathyguy Linux - Newbie 1 02-11-2006 06:34 PM
Linux Startup Scripts for Oracle Application & Database research2004 Linux - Newbie 1 04-14-2004 05:22 AM
Oracle 9i Start/Stop scripts vous Linux - Software 0 01-16-2004 01:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration