password file as std input to script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting password file as std input to script
# 1  
Old 08-31-2011
password file as std input to script

I'm a fairly new AIX admin (disclaimer).
We have SQL scripts written by end users that use a userid and passwd to connect to our DB2 database.
Is it possible to create an "input file" that contains the db2 connect parameters and yet secure the file from the SQL creator?

i.e., they can "use" the password file, but can't "read" it.

Or is there a better way to skin this cat? (no offfense cat lovers!)
# 2  
Old 09-01-2011
You could write a setuid wrapper client that as root or an admin account can relate their local login to the file owned and only readable by the admin account. What sorts of clients do they use? Command line only, gui?

Sharing an id is not a good idea. Is there still authentication?

You could give them a web service, and the web server only would access the file.
This User Gave Thanks to DGPickett For This Post:
# 3  
Old 09-01-2011
Currently is is only aix command line. Here's some detail:

less qry1.sql
db2 -f pswd
db2 -x "select ...............from............" > extract.out


less pswd
connect to db test user userid using password
-----------------------------------------------------------------------
I want to protect unauthorized aix cmd line users from viewing the pswd file, but need it to be "usable" by the qry.sql script.

Should I just chown for all the sql scripts so the users can't look at them, or is there a way to allow them rwx on their sql scripts, but not the pswd file?

BTW, thanks for your response.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help OS X script : password input

Hello Sorry for the question.. i would like to make a script for OS X that allow me to change the password for a user account. i have to use this script on several iMac with the same user/password. i want to store the passwords inside the script, no security problems involved. the... (9 Replies)
Discussion started by: araan87
9 Replies

2. Shell Programming and Scripting

Input password to bash script, save, and enter when needed

I am looking for a way to start a script and have it prompt for a password that will be used later on in the script to SSH to another host and to SFTP. I don't want the password to be hard coded. Below is my script with the actual IP's and usernames removed. #!/usr/bin/expect -f... (2 Replies)
Discussion started by: jbrass
2 Replies

3. Shell Programming and Scripting

Shell script password input

hy, I wrote a simple shell script to monitor (with Nagios) a SNX VPN function. Here the Code snippet: testing=`ssh user@IP-address 'ls /etc/sysconfig/network-scripts/ifcfg-eth0'` #echo $testing if ; then echo "VPN is working" exit 0 else snx -s server -u user ... (2 Replies)
Discussion started by: tomies
2 Replies

4. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

5. Shell Programming and Scripting

Script to input encrpyted password into htdigest (Apache)

Hey guys, This is my situation. I'm using the script to add a user account, however, i want the same details copied into the htdigest password list. the format is username:virtualservername:hashed/encrypted password. This is the command : sudo htdigest /etc/apache2/passwords... (0 Replies)
Discussion started by: xxxx
0 Replies

6. Shell Programming and Scripting

How to read multiple lines from Std Input into an array

Hi All, Does anyone know how to read multiple lines from standard input into an array and then iterate a loop for all the lines read. Below is an example pseudocode: I need the below filenames to be read by the script into an array or something similar: And then in the script, I... (9 Replies)
Discussion started by: bharath.gct
9 Replies

7. Shell Programming and Scripting

Need script to take input from file, match on it in file 2 and input data

All, I am trying to figure out a script to run in windows that will allow me to match on First column in file1 to 8th Column in File2 then Insert file1 column2 to file2 column4 then create a new file. File1: 12345 Sam 12346 Bob 12347 Bill File2:... (1 Reply)
Discussion started by: darkoth
1 Replies

8. Shell Programming and Scripting

PDKSH dual std input threads

Hi All, I'm trying to read from two files at the same time, but the second READ is failing, giving no value. Obvious STDIN is being used by the first "while read", so how can I retrieve a value from a second file within the loop ?? IFS=" ," cat $DATAFILE | while read curdate currentcksum... (3 Replies)
Discussion started by: adrianmarsh
3 Replies

9. Programming

Sun Studio C++ - Getting error in linking std::ostream &std::ostream::operator<<(std:

Hello all Im using CC: Sun C++ 5.6 2004/07/15 and using the -library=stlport4 when linkning im getting The fallowing error : Undefined first referenced symbol in file std::ostream &std::ostream::operator<<(std::ios_base&(*)(std::ios_base&))... (0 Replies)
Discussion started by: umen
0 Replies

10. Shell Programming and Scripting

How to redirect std out and std err to same file

Hi I want both standard output and standard error of my command cmd to go to the same file log.txt. please let me know the best commandline to do this. Thanks (2 Replies)
Discussion started by: 0ktalmagik
2 Replies
Login or Register to Ask a Question