Sponsored Content
Top Forums Shell Programming and Scripting Encrypt and decrypt the password in a Shell Script Post 302959687 by ronitreddy on Thursday 5th of November 2015 10:05:54 AM
Old 11-05-2015
Encrypt and decrypt the password in a Shell Script

Hello,

I have the following UNIX shell script which connects to the teradata database and executes the SQL Queries. For this, I am passing database name, username and password. I don't want to reveal my password to anyone. So, is there any way that I can encrypt my password and read the password while executing the script. How can I achieve this?

Code:
#!/bin/sh
a="temp.btq"
> $a
echo ".LOGON DEV/p2123,password">>$a

Any help is really appreciated. Thanks in advance.
 

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

Encrypt and Decrypt script

Dear Experts, I am using one script name :volume.sh and its written in bash shell script. I just want to encrypt the script so that any one else cannot see it. please tell me the commands how to encrypt the script as well as to decrypt it. Regards, SHARY (9 Replies)
Discussion started by: shary
9 Replies

3. Shell Programming and Scripting

How to encrypt and decrypt a file

How to encrypt and decrypt a file using unix Command? Can any one help me? (2 Replies)
Discussion started by: laknar
2 Replies

4. Shell Programming and Scripting

how to set password/encrypt a shell script

Hi, I have written a shell script in unix for my customer. Now I want to make it only execute and not to read/write. Can anybody help me how to set password protect/encript my script. Thanks Suresh (3 Replies)
Discussion started by: suresh3566
3 Replies

5. Shell Programming and Scripting

how to encrypt a password in shell script

Hi, I have run the below script which is connected to db2 v9.5. There is no issue. The only problem is how to encrypt the dbpwd? #!/bin/ksh #---- Set Environment dbalias="dev1db" dbuser="user1" dbpwd="password" #---- Connect to the Database cd /opt/ibm/db2/V9.5/bin db2 "connect to... (1 Reply)
Discussion started by: lookinginfo
1 Replies

6. Shell Programming and Scripting

Bash Script to decrypt encrypt log and archive

Hi Please see if you have come across any aprts of this. I can read, integrate and syntehsixe. Any help you could offer me would be super. thanks in advance! Good day. Thank you for your response in this matter. Here are some further details: 1) scripting is to be in BASH... (1 Reply)
Discussion started by: cdc01
1 Replies

7. Shell Programming and Scripting

Encrypt and Decrypt

I have script for all oracle prod db. I have hard coded the username / password. I need a mechanism to encode and decode the username / password in a shell script. Another challenge is I use the username and password in a Select command for oracle DB. How can call the decrypted... (2 Replies)
Discussion started by: ilugopal
2 Replies

8. Shell Programming and Scripting

Encrypt Password file and decrypt in a shell script

Hi All, I have stored Oracle database passwords in a hidden file - .pass_file. My shell script reads the hidden file, gets the password and then logs in to the Oracle database and runs some SQL script. My requirement is: I need to provide the shell script to be executed by someone else. So,... (1 Reply)
Discussion started by: sunpraveen
1 Replies

9. Shell Programming and Scripting

Encrypt and decrypt a password in shell script

Hi All, very good morning all. I am trying to connect to informatica repository by using shell script. I have written pmrep connect command in the script file. But i need to provide repository, domain ,username and password to connect. Username and password are hard coded in the script... (8 Replies)
Discussion started by: SekhaReddy
8 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
DROPDB(1)						  PostgreSQL Client Applications						 DROPDB(1)

NAME
dropdb - remove a PostgreSQL database SYNOPSIS
dropdb [ options... ] dbname DESCRIPTION
dropdb destroys an existing PostgreSQL database. The user who executes this command must be a database superuser or the owner of the data- base. dropdb is a shell script wrapper around the SQL command DROP DATABASE [drop_database(7)] via the PostgreSQL interactive terminal psql(1). Thus, there is nothing special about dropping databases via this or other methods. This means that the psql must be found by the script and that a database server is running at the targeted host. Also, any default settings and environment variables available to psql and the libpq front-end library do apply. OPTIONS
dropdb accepts the following command-line arguments: dbname Specifies the name of the database to be removed. The database must be one of the existing PostgreSQL databases in this installa- tion. -e --echo Echo the queries that dropdb generates and sends to the server. -i --interactive Issues a verification prompt before doing anything destructive. -q --quiet Do not display a response. createdb also accepts the following command-line arguments for connection parameters: -h host --host host Specifies the host name of the machine on which the server is running. If host begins with a slash, it is used as the directory for the Unix domain socket. -p port --port port Specifies the Internet TCP/IP port or local Unix domain socket file extension on which the server is listening for connections. -U username --username username User name to connect as -W --password Force password prompt. DIAGNOSTICS
DROP DATABASE The database was successfully removed. dropdb: Database removal failed. Something didn't work out. If there is an error condition, the backend error message will be displayed. See DROP DATABASE [drop_database(7)] and psql(1) for possi- bilities. ENVIRONMENT
PGHOST PGPORT PGUSER Default connection parameters EXAMPLES
To destroy the database demo on the default database server: $ dropdb demo DROP DATABASE To destroy the database demo using the server on host eden, port 5000, with verification and a peek at the underlying query: $ dropdb -p 5000 -h eden -i -e demo Database "demo" will be permanently deleted. Are you sure? (y/n) y DROP DATABASE "demo" DROP DATABASE SEE ALSO
createdb(1), DROP DATABASE [drop_database(7)] Application 2002-11-22 DROPDB(1)
All times are GMT -4. The time now is 03:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy