Sponsored Content
Top Forums Shell Programming and Scripting Oracle Passwords in Unix scripts Post 302194764 by Smiling Dragon on Tuesday 13th of May 2008 07:02:09 PM
Old 05-13-2008
FWIW, storing the password in an environment variable makes the information available to all users with access to a bsd ps on the box.

Are you able to use sudo? You could store the passwords in a central set of files, readable only by specific groups.

Create specific system users and allocate them to the appropriate groups.

You can then allow certain users to run your various scripts as the specific system users. Your script then goes and looks up the file in question for the DB and uses the password contained within.

This also gives you the ability to create a script for retrieving passwords inline for users with the appropriate rights (say admins only?) to use in _any_ script they want.

eg:
Code:
some_oracle_supplied_command -user `sudo -u orapass /usr/local/bin/get_the_username MY_DB` -pass ``sudo -u orapass /usr/local/bin/get_the_password MY_DB`

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix passwords?

The local policy is set in our LAN so that passwords have to be 8 characters and contain a capital letter, a small letter and a special character. Is Unix able to restrict users passwords to certain lengths and characters. (1 Reply)
Discussion started by: wmosley2
1 Replies

2. UNIX for Advanced & Expert Users

Connecting to Oracle through unix shell scripts

Hi, Can some one help me in connecting to oracle through unix shell scripts with examples. Regards Narayana Gupta (1 Reply)
Discussion started by: guptan
1 Replies

3. Shell Programming and Scripting

How to pass passwords to bash scripts?

I'm finding the following command very tedious to type in all the time, so I created a one line bash script called mount.bash with the following contents: mount -t cifs //mark/C\$ -o unc=//mark\\C$,ip=10.1.1.33,user=Administrator,password=$1 /mnt/mark I don't like the fact that I have to put... (5 Replies)
Discussion started by: siegfried
5 Replies

4. Shell Programming and Scripting

Checking passwords - scripts

Hi Unix experts.... I am in the process checking user and root password of more than 1000 servers manulay. I am very pissed of checking these many servers manualy. Could some one of you help me how can i check the passwords just by runing some scripts..! Need Help Guys..! :confused: (5 Replies)
Discussion started by: bullz26
5 Replies

5. Shell Programming and Scripting

SSH - Passing Unix login passwords through shell scripts

Hi All , I need to call a script runscript_B.sh on server A, the runscript_B.sh script locating in server B. The runscript_B.sh in calls another script runscript_A on server A itself. it seend, i need to be connect from Server A to Server B using ssh. I have tryed like this in... (3 Replies)
Discussion started by: koti_rama
3 Replies

6. Shell Programming and Scripting

Calling oracle package Unix from shell scripts.

Hi, Can anyone tell me how to call a oracle package from a Unix shell script? I want to pass some input parameters to package and it will return me the output which I want to use further in my shell script. I want to know the way to capture the output values in my shell script. Please send some... (1 Reply)
Discussion started by: anil029
1 Replies

7. Shell Programming and Scripting

run oracle procedure in unix scripts

for j in $(du -h $1| awk '{printf("%100-s \n",$2)}') do for a in $(ls -time $(find $j -name '*.txt') | awk '{printf("\n%s %s %s %s %s",$4,$7,$8,$10,$11)}') do echo "$a">output.txt done done exit 0 echo "Password : xxxxxx " > LOG/BGH_$3.out (0 Replies)
Discussion started by: utoptas
0 Replies

8. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

9. UNIX for Advanced & Expert Users

When did UNIX start using encrypted passwords, and not displaying passwords when you type them in?

I've been using various versions of UNIX and Linux since 1993, and I've never run across one that showed your password as you type it in when you log in, or one that stored passwords in plain text rather than encrypted. I'm writing a script for work for a security audit, and two of the... (5 Replies)
Discussion started by: Anne Neville
5 Replies

10. Shell Programming and Scripting

How to store the passwords securely and use in scripts?

I want to store the passwords in a global file, so that all the users will not use them to login but a process should use it. One way is to keep the passwords in a .ini file and execute the file in the start of the script and use that variable. But with this, one can echo the variable in the... (15 Replies)
Discussion started by: karumudi7
15 Replies
ADDING_USER(8)						    BSD System Manager's Manual 					    ADDING_USER(8)

NAME
adding_user -- procedure for adding new users DESCRIPTION
A new user must choose a login name, which must not already appear in /etc/passwd or /etc/mail/aliases. It must also not begin with the hyphen '-' character. It is strongly recommended that it be all lower-case, and not contain the dot '.' character, as that tends to confuse mailers. An account can be added by editing a line into the passwd file; this must be done with the password file locked e.g. by using chpass(1) or vipw(8). A new user is given a group and user id. Login and user id's should be unique across the system, and often across a group of systems, since they are used to control file access. Typically, users working on similar projects will be put in the same groups. At the University of California, Berkeley, we have groups for system staff, faculty, graduate students, and special groups for large projects. A skeletal account for a new user ``ernie'' might look like: ernie::25:30::0:0:Ernie Kovacs,508 Evans Hall,x7925, 642-8202:/a/users/ernie:/bin/csh For a description of each of these fields, see passwd(5). It is useful to give new users some help in getting started, supplying them with a few skeletal files such as .profile if they use /bin/sh, or .cshrc and .login if they use /bin/csh. The directory /usr/share/skel contains skeletal definitions of such files. New users should be given copies of these files which, for instance, use tset(1) automatically at each login. FILES
/etc/master.passwd user database /usr/share/skel skeletal login directory SEE ALSO
chpass(1), finger(1), passwd(1), aliases(5), passwd(5), adduser(8), pwd_mkdb(8), vipw(8) BSD
January 30, 2009 BSD
All times are GMT -4. The time now is 12:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy