Sponsored Content
Top Forums Shell Programming and Scripting Encrypt and decrypt the password in a Shell Script Post 302959736 by Showdown on Thursday 5th of November 2015 01:42:15 PM
Old 11-05-2015
To the best of my knowledge there is no robust way to encrypt/decrypt password in shell scripts. However you can try the below 4 approaches.

1. keep the username/password in a config file in some safe place and change the permission of that file and extract the credentials to use in your script.
2. Pass the username,password,DB name as command line arguments. $1 $2 $3
3. install the crypt package
4 The best method is to find the equivalent of " Oracle wallet manager" for Teradata which will keep the credentials secret forever.
 

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
Authen::Simple::Adapter(3pm)				User Contributed Perl Documentation			      Authen::Simple::Adapter(3pm)

NAME
Authen::Simple::Adapter - Adapter class for implementations SYNOPSIS
package Authenticate::Simple::Larry; use strict; use base 'Authen::Simple::Adapter'; __PACKAGE__->options({ secret => { type => Params::Validate::SCALAR, default => 'wall', optional => 1 } }); sub check { my ( $self, $username, $password ) = @_; if ( $username eq 'larry' && $password eq $self->secret ) { $self->log->debug( qq/Successfully authenticated user '$username'./ ) if $self->log; return 1; } $self->log->debug( qq/Failed to authenticate user '$username'. Reason: 'Invalid credentials'/ ) if $self->log; return 0; } 1; DESCRIPTION
Adapter class for implementations. METHODS
o new ( %parameters ) If overloaded, this method should take a hash of parameters. The following options should be valid: o cache ( $ ) Any object that supports "get", "set". Only successful authentications are cached. cache => Cache::FastMmap->new o callback ( & ) A subref that gets called with two scalar references, username and password. callback = sub { my ( $username, $password ) = @_; if ( length($$password) < 6 ) { return 0; # abort, invalid credintials } if ( $$password eq 'secret' ) { return 1; # abort, successful authentication } return; # proceed; } o log ( $ ) Any object that supports "debug", "info", "error" and "warn". log => Log::Log4perl->get_logger('Authen::Simple') log => $r->log log => $r->server->log o init ( \%parameters ) This method is called after construction. It should assign parameters and return the instance. sub init { my ( $self, $parameters ) = @_; # mock with parameters return $self->SUPER::init($parameters); } o authenticate ( $username, $password ) End user method. Applies callback, checks cache and calls "check" unless aborted by callback or a cache hit. o check ( $username, $password ) Must be implemented in sublcass, should return true on success and false on failure. o check_password( $password, $encrypted ) o options ( \%options ) Must be set in subclass, should be a valid Params::Validate specification. Accessors for options will be created unless defined in sublcass. __PACKAGE__->options({ host => { type => Params::Validate::SCALAR, optional => 0 }, port => { type => Params::Validate::SCALAR, default => 80, optional => 1 } }); SEE ALSO
Authen::Simple Authen::Simple::Password Params::Validate AUTHOR
Christian Hansen "chansen@cpan.org" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-04-19 Authen::Simple::Adapter(3pm)
All times are GMT -4. The time now is 02:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy