Operating System - HP-UX
1833875 Members
3155 Online
110063 Solutions
New Discussion

any way to encrypt passwords in shell scripts?

 
Philip Choi_1
New Member

any way to encrypt passwords in shell scripts?

I need to use passwords in shell scripts to login to other systems and use pgp and such. Is there any way to encrypt the passwords in shell scripts? I'm sure this is a generally encountered problem in unix environments.
5 REPLIES 5
G. Vrijhoeven
Honored Contributor

Re: any way to encrypt passwords in shell scripts?

Hi P.

I would go for ssh or scp. Its reliable and the password would not go clear text over the network.

Gideon
John Dvorchak
Honored Contributor

Re: any way to encrypt passwords in shell scripts?

I would suggest that you use ssh as mentioned before but to actually encrypt the password in the script the only thing I can think of is to either us ed with the crypt option set or to use cryp (man (1) crypt) to encrypt the script. I have never tried to encrypt a script but I don't know why it wouldn't work. That would prevent anyone, unless they knew the cryp "key" from reading the script. It would still send the password in clear text across the LAN, that's why using ssh is more secure.
If it has wheels or a skirt, you can't afford it.
Steven E. Protter
Exalted Contributor

Re: any way to encrypt passwords in shell scripts?

If you go with ssh, here is a cookbook on how to set up password free ssh login.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Philip Choi_1
New Member

Re: any way to encrypt passwords in shell scripts?

Thanks guys for your responses. I'm going to have to study this a bit. How do I assign points?
G. Vrijhoeven
Honored Contributor

Re: any way to encrypt passwords in shell scripts?