The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
A program to trace execution of another program jiten_hegde High Level Programming 3 08-19-2008 02:26 AM
How to write to stdin of another program (program A -> [stdin]program B) vvaidyan UNIX for Dummies Questions & Answers 3 08-02-2008 02:21 PM
UserID password validation using C program AIX_user AIX 1 06-15-2006 12:00 PM
script/program to change the password ? kad Shell Programming and Scripting 0 06-01-2006 04:02 AM
Change password by pushing encrypted password to systems benq70 UNIX for Dummies Questions & Answers 1 09-02-2005 06:08 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-29-2005
Registered User
 

Join Date: Jul 2005
Posts: 30
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!
Reply With Quote
Forum Sponsor
  #2  
Old 12-29-2005
linuxpenguin's Avatar
Registered User
 

Join Date: May 2002
Location: India
Posts: 295
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.
__________________
War doesnt determine who is right, it determines who is left
Reply With Quote
  #3  
Old 12-29-2005
Registered User
 

Join Date: Jul 2005
Posts: 30
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.

?
Reply With Quote
  #4  
Old 12-29-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Take a look at sudo.

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

Cheers
ZB
Reply With Quote
  #5  
Old 12-29-2005
Registered User
 

Join Date: Jul 2005
Posts: 30
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?
Reply With Quote
  #6  
Old 12-29-2005
linuxpenguin's Avatar
Registered User
 

Join Date: May 2002
Location: India
Posts: 295
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
__________________
War doesnt determine who is right, it determines who is left
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0