04-08-2010
Encrypt the password ,decrypt it,source it in an expect script...!!
Hello folks
I have a conf file ,say 'pass.conf' ,which is storing ascii password : PASS1111.
I need to encrypt this password once and store it in a file.
I ,then need to write a script which would read this encrypted password and decrypts it.The o/p o this script shud be this decrypted password ,which i would get it set in an expect script.
I need some guidance on it as i am not exactly clear how to do it.
I know how to set password in expect script using 'exec'.
For other stuff,i need advice/help.
Regards
Abhi
Last edited by ak835; 04-08-2010 at 10:13 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
To perform a black box testing and get users' feedback, we are planning to deploy a script in a common location and ask users to execute the script. However we do not want them to have a look at the script until the testing is done. I know this is against the open source concept, but it will be for... (7 Replies)
Discussion started by: krishmaths
7 Replies
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
Dear All,
I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Discussion started by: ss112233
5 Replies
10. Shell Programming and Scripting
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... (2 Replies)
Discussion started by: ronitreddy
2 Replies
LEARN ABOUT CENTOS
ssl_ctx_set_default_passwd_cb
SSL_CTX_set_default_passwd_cb(3) OpenSSL SSL_CTX_set_default_passwd_cb(3)
NAME
SSL_CTX_set_default_passwd_cb, SSL_CTX_set_default_passwd_cb_userdata - set passwd callback for encrypted PEM file handling
SYNOPSIS
#include <openssl/ssl.h>
void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb);
void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u);
int pem_passwd_cb(char *buf, int size, int rwflag, void *userdata);
DESCRIPTION
SSL_CTX_set_default_passwd_cb() sets the default password callback called when loading/storing a PEM certificate with encryption.
SSL_CTX_set_default_passwd_cb_userdata() sets a pointer to userdata which will be provided to the password callback on invocation.
The pem_passwd_cb(), which must be provided by the application, hands back the password to be used during decryption. On invocation a
pointer to userdata is provided. The pem_passwd_cb must write the password into the provided buffer buf which is of size size. The actual
length of the password must be returned to the calling function. rwflag indicates whether the callback is used for reading/decryption
(rwflag=0) or writing/encryption (rwflag=1).
NOTES
When loading or storing private keys, a password might be supplied to protect the private key. The way this password can be supplied may
depend on the application. If only one private key is handled, it can be practical to have pem_passwd_cb() handle the password dialog
interactively. If several keys have to be handled, it can be practical to ask for the password once, then keep it in memory and use it
several times. In the last case, the password could be stored into the userdata storage and the pem_passwd_cb() only returns the password
already stored.
When asking for the password interactively, pem_passwd_cb() can use rwflag to check, whether an item shall be encrypted (rwflag=1). In
this case the password dialog may ask for the same password twice for comparison in order to catch typos, that would make decryption
impossible.
Other items in PEM formatting (certificates) can also be encrypted, it is however not usual, as certificate information is considered
public.
RETURN VALUES
SSL_CTX_set_default_passwd_cb() and SSL_CTX_set_default_passwd_cb_userdata() do not provide diagnostic information.
EXAMPLES
The following example returns the password provided as userdata to the calling function. The password is considered to be a '