The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Hide Password whatisthis Shell Programming and Scripting 4 07-21-2008 09:59 AM
Want to hide password arpitk Shell Programming and Scripting 1 09-29-2006 09:42 AM
Hide oracle password on unix process list acheepi Shell Programming and Scripting 3 10-06-2005 10:25 PM
How to hide password on Linux? nir_s Shell Programming and Scripting 2 02-09-2005 12:24 PM
hide password typing ivancheung High Level Programming 2 09-30-2004 02:05 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-21-2006
samd samd is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 3
How Do I Hide the Password in a Script

Hi,

I am writing a UNIX .ksh script and need to send the login password of the login id that is executing the script to a command that I am executing in the script. I don't want that password to be seen by anyone except whoever is executing the script.

Does anyone know how I can accomplish this?

Thanks

SD
  #2 (permalink)  
Old 11-21-2006
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 430
you can just get the encrypted password
  #3 (permalink)  
Old 11-21-2006
Andrek Andrek is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 122
Whats the command you are running in the script that needs a passwd?
Is it FTP?
  #4 (permalink)  
Old 11-21-2006
samd samd is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 3
It is a command that I am not sure is UNIX or home-grown. It is "become" which lets a user become another user (like su). In my script I have a line:
>become userid

I need to send the become command the user id of the user who is executing the script because, when run on the command line, the "become" command prompts for the user's password who is running the script.

SD
  #5 (permalink)  
Old 11-21-2006
samd samd is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 3
funksen, is there a way to pass that encrypted password to the command in my script?

SD
  #6 (permalink)  
Old 11-21-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
If the become command just reads from stdin, then all you have to do is something like this:

Code:
crypt key < /path/to/file/with/encrypted_passwd | become username
But if the become command is going to behave like passwd does, then I don't think it will be possible.
  #7 (permalink)  
Old 11-22-2006
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 430
Quote:
funksen, is there a way to pass that encrypted password to the command in my script?

SD
Reply With Quote
I don't think so, the command expects the password in cleartext and not the encrypted password

in your case I would rather use sudo and specify the "su" command for use without a password
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0