Encrypting the password

Iam using the teradata...
and running the scripts in unix,
I wan to encrypt the teradata password in Unix...

my hostname is : bprod
usename: KRN777
passwrd: passwrd

can ant one tell me the exact command to encrypth the passwrd....

thanks,

What do you mean by 'encrypt the password'. Obfuscate it so that people reading the script can't get at it?

If you actually need to use the password in the script in an unimpeded and automatic way, there's no point. Anyone who'd be able to see your script would also be able to see the decryption code.

So stop people reading the script. chmod 100 script.sh would be more effective. You could make it belong to one specific user, perhaps, and disable logins for that user, so you can only run it with sudo -u username /path/to/script.sh You'd need to configure sudo to allow that of course.

i think by using
PWD=`ftppwd hostname username`;

i dont know how to use or declare the password in it
or encrypt in it

PWD isn't password, it's "print working directory".

You're going to need to be a lot clearer about what you want, and post more of your script, so we can have at least an inkling of what you're trying to do.

BOFA_PWD is like variable
export BOFA_PWD=`ftppwd KRNSS PTP`;
bteq << EOF
.logon KRNSS/PTP,$BOFA_PWD;

in the above.... KRNSS is hostname..... PTP is username
and
.logon is teradata command hostname/username,passwrd..

Wherever I see ftppwd, it's 'print working directory', not 'password'.

But, assuming ftppwd is actually a command that produces passwords (shudder), I think my answer holds. Obfuscating a password is pointless when you can't keep it obfuscated: The instant you decrypt it and use it, it becomes vulnerable again.

Depending on whatever .logon actually is there may be noninteractive authentication methods available though. I can't tell from what little you're willing to post.