Sponsored Content
Full Discussion: How to Encrypt password
Top Forums Shell Programming and Scripting How to Encrypt password Post 302364443 by zaxxon on Friday 23rd of October 2009 05:15:04 AM
Old 10-23-2009
Not knowing your environment here we go:
Why does the password variable has to be exported? Can't they just enter the password at a prompt/command when connecting to the DB?

Aren't they already authenticated when being logged in with their personal account on the Linux/Unix box?

You could write an script that manages passwords and environments where the passwords are crypted via md5sum and stored or something.
Code:
> echo "sEcr3t_Pa55w0rD"| md5sum
162e9737394caf8c5980281730b97a77  -

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

encrypt and decrypt password

how do i encrypt and decrypt a password (2 Replies)
Discussion started by: sanwish
2 Replies

2. Shell Programming and Scripting

Expect Script....encrypt password and use

Could someone please help me...I have an expect script. There's a need for a log in during the script and a password is required...right now the password is just a variable in the expect script...what would be the best way to put that in an encrypted flat file and have the expect script pull the... (2 Replies)
Discussion started by: cubs0729
2 Replies

3. UNIX and Linux Applications

How to encrypt oracle password table ?

Hi Oracle & Unix expert, Could you tell me how to encrypt oracle table ? Thanks. (1 Reply)
Discussion started by: olaris
1 Replies

4. Shell Programming and Scripting

Encrypt and save password

Hello all, I need to encrypt and save a password in a file and later decrypt to determine the original password string. Please suggest how can I use the linux commands or other approach to accomplish this. Thanks for your help. (1 Reply)
Discussion started by: cheerful
1 Replies

5. Shell Programming and Scripting

How to hide/encrypt password in script?

Hi I have following problem Im writing a script (in bash ) , where need to be written login & passwd for databas client . Its need to in following form login passwd@dbhostname . The problem is so anybody can read it so the passwd & login are visible and thats not very safety . Can... (8 Replies)
Discussion started by: kvok
8 Replies

6. Shell Programming and Scripting

DB2 Connect Encrypt Password

Hi All, If someone can help me with password encryption. We have shell scripts that connect to a database using db2 connect and we have the password hardcoded in the script. Can someone let me know if there's a way to encrypt this password? I've seen alot of users suggest we create an... (3 Replies)
Discussion started by: rethymno19
3 Replies

7. Shell Programming and Scripting

Encrypt password but use * when typing password

Hi, I came across the following script for encrypting the password in this forum #! /usr/bin/ksh exec 4>/dev/tty function getpass { typeset prompt=$1 typeset backspace=$(echo \\b\\c) typeset enter=$(echo \\r\\c) typeset savesetting=$(stty -g) ... (9 Replies)
Discussion started by: dbashyam
9 Replies

8. Shell Programming and Scripting

Encrypt DB password in Script

Hi, I have a SQL which i want to run through a shell script. query_result=`/home/oracle/product/11.2.0/bin/sqlplus -S uname/pwd@DBNAME <<! set heading off feedback off trimspool on set pagesize 0 set linesize 9999 spool $PARAM_PATH/param_name.txt; Select sysdate from dual; spool off;... (6 Replies)
Discussion started by: chetan.c
6 Replies

9. Shell Programming and Scripting

Encrypt Plaintext Password?

How do I encrypt a plaintext password that I need hardcoded in a bash script? (3 Replies)
Discussion started by: wyclef
3 Replies

10. UNIX for Beginners Questions & Answers

Encrypt and Decrypt a File with Password

Hello, I have few files on unix which are payroll related and I need them to encrypt with password so others wouldn't see the data. I use ETL tool and would like to know the unix command that does encryption/decryption to use in the ETL. Thank you, Sri (3 Replies)
Discussion started by: eskay
3 Replies
PWHASH(1)						    BSD General Commands Manual 						 PWHASH(1)

NAME
pwhash -- hashes passwords from the command line or standard input SYNOPSIS
pwhash [-km] [-b rounds] [-S rounds] [-s salt] [-p | string] DESCRIPTION
pwhash prints the encrypted form of string to the standard output. This is mostly useful for encrypting passwords from within scripts. The options are as follows: -b rounds Encrypt the string using Blowfish hashing with the specified rounds. -k Run in makekey(8) compatible mode. A single combined key (eight chars) and salt (two chars) with no intermediate space are read from standard input and the DES encrypted result is written to standard output without a terminating newline. -m Encrypt the string using MD5. -p Prompt for a single string with echo turned off. -S rounds Encrypt the salt with HMAC-SHA1 using the password as key and the specified rounds as a hint for the number of iterations. -s salt Encrypt the string using DES, with the specified salt. If no string is specified, pwhash reads one string per line from standard input, encrypting each one with the chosen algorithm from above. In the event that no specific algorithm is given as a command line option, the algorithm specified in the default class in /etc/passwd.conf will be used. For MD5 and Blowfish a new random salt is automatically generated for each password. Specifying the string on the command line should be discouraged; using the standard input is more secure. FILES
/etc/passwd.conf SEE ALSO
crypt(3), passwd.conf(5) BSD
October 16, 2009 BSD
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy