![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| password in shell script | rajbkriz | Shell Programming and Scripting | 0 | 01-23-2008 02:17 AM |
| Encrypting a script...... | prashantshukla | SUN Solaris | 6 | 12-31-2007 12:53 AM |
| set password using a shell script | tannu | Shell Programming and Scripting | 2 | 09-07-2007 01:26 AM |
| masking or encrypting in shell script | dshrish | UNIX for Dummies Questions & Answers | 4 | 02-16-2006 01:35 AM |
| Encrypting password | Justman | AIX | 6 | 12-16-2004 09:08 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Encrypting a password for shell script
All,
I want to encrypt a database system administration password into a file or environment variable. Then, I want to decrypt the password from the file or environment variable so nobody sees the clear text password. For example, I have the database password of developement. I need to execute the following line to access the database: isql -Usysadmin -Pdevelopment I want users not to see the development password in clear text. Thanks! |
|
|||||
|
One way encryption is fairly straight forward with Unix, and can be achieved using the "crypt" command (if available) or system call, or using the crypt() function in Perl, PHP and others. The problem with this is exactly that - it's one way. You can't decrypt a "crypt"ed password (otherwise /etc/{passwd,shadow} would be useless as authentication mechanisms).
The problem is that the -P option to isql expects the "true" password, not an encrypted variant. It may or may not be visible in ps output listings. Some related threads that might assist you can be found here: Hiding password from ps Hiding login/password in process! I do a lot of PHP/PostgreSQL web programming, and I request the plain text login over https, then the "login" PHP script encrypts the password and checks it against the encrypted password stored within the "user" table (or whatever it may be called). Not too sure if you could create some kind of web enabled front end for Informix - we use curses for our Informix frontend at work. Hope something there was of use! Cheers ZB |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|