*BSD News Article 72347


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.ysu.edu!news.cps.udayton.edu!news.engr.udayton.edu!blackbird.afit.af.mil!zombie.ncsc.mil!news.mathworks.com!hunter.premier.net!news1.erols.com!newsmaster@erols.com
From: Ken Bigelow <kbigelow@www.play-hookey.com>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: How do I encrypt a password in a sh script
Date: Fri, 28 Jun 1996 09:26:19 -0700
Organization: Erols Internet Services
Lines: 30
Message-ID: <31D407AB.666@www.play-hookey.com>
References: <31d42659.26716616@news.hq.af.mil>
NNTP-Posting-Host: kenjb05.play-hookey.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.02 (Win16; I)

Scott Gregory wrote:
> 
> I have a sh script that FTP's to another machine and downloads some
> files.  I currently have the username and password in the script:
> 
> ftp -n <<EOF
> open foo.bar.com
> user foouser foopassword
> bin
> prompt
> mget *
> quit
> EOF
> 
> Is there any way to encrypt the password??  I would like to make it at
> least a little difficult for someone to get the password : - )
> 
> The script is run as root so its not a problem to change permissions.
> 

I have my doubts about encrypting the password, since it would then have 
to be decrypted before being transmitted. However, I do hope that script 
file is owned by root and is only readable by root
(use chmod 400 filename). I do something like that for a script I setup 
for the cron daemon to use popclient to get e-mail from other hosts for my 
family.

I hope this helps!

Ken