ksh program with password


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh program with password
# 1  
Old 12-29-2005
Lightbulb ksh program with password

Hi,
I am looking for a way to utilize password when the ksh program is launched.
What's the standard or best way to do it?

Thanks for your help!
# 2  
Old 12-29-2005
hmm, there are many standard ways and it only depends on how secure you want it to be. Higher the security you want, higher will be the complexity in the script.
and if you just want to check some string stored in file, it will be easy but not so secure.
# 3  
Old 12-29-2005
password in ksh

ok.
I'd like to know the more secure way to do it since I don't want to other people to see the password.

?
# 4  
Old 12-29-2005
Take a look at sudo.

http://www.sudo.ws/sudo/

Cheers
ZB
# 5  
Old 12-29-2005
sudo V. password

Hi,
I kind of know about sudo command.
But I am looking for a fixed password for my program that could be hidden somewhere.

Can someone give me a hint about it?
# 6  
Old 12-29-2005
Hmm, I overlooked your question. You said shell script. I bliv it wont be easy doing it in a shell script. You can use something like this

========================================
echo "Enter password: \c"
stty -echo
read a
echo "$a" > pwd.txt
crypt encry_key < pwd.txt > pwd.x
rm pwd.txt
stty echo
echo " Password is \c"
crypt encry_key < pwd.x
========================================

However, the problem here is the encryption key (encry_key or any other string) can be easily seen to those who can read the script. Any person who can execute this script can also read it, So in short anyone who can execute this script, can also know the encrption key and thus can also read the encrypted password file.
So, your best bet would be to resort to c programs.
But my knowledge is limited, may be someone on the forum has some good idea here
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh program

Hi, I have a text file with multiple sql statements in which I have pick only the below select update and delete statements and do print as given below. All the select,update,delete statements will be as same as ( subquery with ().all statements ending with ; ) the examples given below. 1)... (19 Replies)
Discussion started by: manasa_vs
19 Replies

2. Shell Programming and Scripting

Automating a Java program using KSH

Hi Guys, We have a java program that basically install updates to an existing software. The java program consist of several screens asking user for choices (please see below for a detailed example) *** Screen 1 *** Please choose the operation you want to perform: 1. Install new... (5 Replies)
Discussion started by: maddmaster
5 Replies

3. UNIX for Dummies Questions & Answers

Shell program with username and password

Hi I am new to unix and I am trying to figure out how to write a shell script with a login name and password. I want to do something along the lines of if both are correct it echoes "you are logged in" and if the password is wrong it echoes "wrong password" and same with the login name. I've tried... (7 Replies)
Discussion started by: thedemonhunter
7 Replies

4. Shell Programming and Scripting

convert ksh to C program

Hi Guys...is there a way to convert a .ksh script to .C program..? (3 Replies)
Discussion started by: aggars
3 Replies

5. Shell Programming and Scripting

Expect program with password as arg

Hi, I have written Expect script that takes root password as argument, and executes another script. The another script prompts for password, which Expect feeds. But Expect shows the password on stdout and in the log. Is there a way to suppress it? (1 Reply)
Discussion started by: illcar
1 Replies

6. Shell Programming and Scripting

Invoke perl program from Ksh

Hi all, Can I invoke a perl script from Ksh script and pass parameters to the perl script. Please do help me.. thanks Maha (10 Replies)
Discussion started by: mahalakshmi
10 Replies

7. AIX

UserID password validation using C program

I am new to AIX. I was wondering if there is a security API on AIX which I can call from my C program to validate the userID and password of a user. My plan is to have my C program prompt the user for UserID and password. I'll then call the AIX security API to determine what authority the user... (1 Reply)
Discussion started by: AIX_user
1 Replies

8. Shell Programming and Scripting

grep within ksh program

Hi, is there problem with grep command when using ksh? I had the below command: /usr/bin/grep \""$Mon $NewDD\"" /tmp/timemanager/intlog.$$ >> /tmp/timemanager/log.$$ 2>/dev/null when I run ksh in debug mode, this command can not grep anything even the data is in the file. + /usr/bin/grep... (3 Replies)
Discussion started by: cin2000
3 Replies

9. Programming

parameters from my program in c to a .ksh script

hi.. this is my question: it is possible transfer parameters from my program written in C to a .ksh script? how can i do it? i have a program in C, what is called from a .ksh script, and i need what the C program returns some values (parameters) please, help me - any idea thanks ... (2 Replies)
Discussion started by: DebianJ
2 Replies

10. UNIX for Advanced & Expert Users

date program in ksh

#Author : kkodava #!/usr/bin/ksh #Use of this program is You can findout the no of days & day of starting and ending dates #usage no_of_days startdate<yyyymmdd> enddate<yyyymmdd> syy=`echo $1|cut -c1-4` smm=`echo $1|cut -c5-6` sdd=`echo $1|cut -c7-8` eyy=`echo $2|cut -c1-4` emm=`echo... (1 Reply)
Discussion started by: krishna
1 Replies
Login or Register to Ask a Question