Sponsored Content
Full Discussion: Encrypt a hardcoded passwd
Operating Systems Solaris Encrypt a hardcoded passwd Post 302778229 by q8devilish on Sunday 10th of March 2013 06:48:45 AM
Old 03-10-2013
Encrypt a hardcoded passwd

hey guys,
is there a way to encrypt a hard coded passwd inside a shell script basically this is my script and i was to encrypt or hide the ftp password.
Code:
#!/bin/sh
HOST='XXXXXXXXX'
USER='XXXXXXXXXX'
PASSWD='XXXXXXXXXXX'


cd /tmp/ftptest
grep -c "{0000000#END#\>" * > NO_OF_CARDS
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
prompt off
ascii
cd /tmp/ftptest
mput *
quit
END_SCRIPT
exit 0

And i can't let the password popup as this script was intended to be automation for a file transfer.
 

10 More Discussions You Might Find Interesting

1. Programming

Help with encrypt function

Hi there, I need to include a simple encryption function in a C program and I came across this function void encrypt(char block, int edflag) whic is defined in #include des_crypt.h. According the man "the block argument to encrypt() is a character array of length 64 containing only the... (1 Reply)
Discussion started by: giggi
1 Replies

2. Shell Programming and Scripting

Tr utility to Encrypt

I need some help.. I would like to make a script that uses the tr utility to "encrypt" a selected file. I need to know how to set up the script so that if i type encrypt(script name) the letter that i want to start the encryption and then the file name, that it starts with the entered letter, and... (1 Reply)
Discussion started by: frankthetank115
1 Replies

3. Shell Programming and Scripting

encrypt my sctipt

Hai , is there any encrypt machanishm to protect my script or logic? (4 Replies)
Discussion started by: readycpbala
4 Replies

4. Shell Programming and Scripting

connection string is hardcoded

Hi, I have many perl scripts in single server, i am new to perl, suggestions are appreciated. connection string is hardcoded in all perl scripts i need to make change the all perl scripts and there should be only one config file available in that server. destination database is mysql... (3 Replies)
Discussion started by: prakash.gr
3 Replies

5. Shell Programming and Scripting

How to Encrypt password

Hello, I have a paramter file, In which I store all the user-ids and passwords for the project. So if a user just invokes the paramter file he has access to all the variables, which i have exported in the parmatere file. Now if a user echo's the variable which stores the databse password.... (1 Reply)
Discussion started by: DSDexter
1 Replies

6. UNIX for Dummies Questions & Answers

how to enter hardcoded password automatically

In the script i am passing a command from script which is called from cron. When this command is called from cron the unix prompt asks for password. Can we automatically enter the password when promted(if the password is hardcoded in script)?? Please let me know how to enter the password... (4 Replies)
Discussion started by: abhi_n123
4 Replies

7. Solaris

passwd cmd reenables passwd aging in shadow entry

Hi Folks, I have Solaris 10, latest release. We have passwd aging set in /etc/defalut/passwd. I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging. When I reset the users passwd using passwd command, it re enables... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

8. UNIX for Dummies Questions & Answers

Issue with use of Configuration file instead of hardcoded values inside the script

Hi, My code works perfectly fine. But, $my $min_to_add = 1 * 1 * 60; and my $hr_to_sub = 1 * 1 * 86400; i may need to change the values in future. so am keeping them in a separate configuration file like MIN = 1 * 1 * 60 HR = 24 * 60 * 60 in the script, i use a package use et_config... (3 Replies)
Discussion started by: irudayaraj
3 Replies

9. Shell Programming and Scripting

Need help with file encrypt

Hi I need to encrypt the below file using the translate command to shift each letter five characters to the end of the character set. ALPHABETICAL FACTS. THE FIRST THREE LETTERS ARE ABC. THE MEDIAN LETTERS ARE MN. THE LAST THREE LETTERS ARE XYZ. THE FIRST WORD IN MY DISCTIONARY IS AAL. THE... (1 Reply)
Discussion started by: drew211
1 Replies

10. AIX

When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords?

Does anyone know when AIX started using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? (1 Reply)
Discussion started by: Anne Neville
1 Replies
crypt(3C)																 crypt(3C)

NAME
crypt - generate hashing encryption SYNOPSIS
Obsolescent Interfaces DESCRIPTION
crypt(): is the password encryption function. It is based on a one way hashing encryption algorithm with variations intended (among other things) to frustrate use of hardware implementations of a key search. key is a user's typed password. salt is a two-character string chosen from the set this string is used to perturb the hashing algorithm in one of 4096 different ways, after which the password is used as the key to encrypt repeatedly a constant string. The returned value points to the encrypted password. The first two characters are the salt itself. Obsolescent Interfaces generate hashing encryption. WARNINGS
The return value for points to data whose content is overwritten by each call. and are obsolescent interfaces supported only for compatibility with existing DCE applications. New multithreaded applications should use SEE ALSO
crypt(1), login(1), passwd(1), getpass(3C), passwd(4), thread_safety(5). STANDARDS CONFORMANCE
crypt(3C)
All times are GMT -4. The time now is 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy