*BSD News Article 72362


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!paladin.american.edu!gatech!newsfeed.internetmci.com!hunter.premier.net!netnews.worldnet.att.net!ix.netcom.com!netcom.net.uk!dispatch.news.demon.net!demon!jraynard.demon.co.uk!not-for-mail
From: james@jraynard.demon.co.uk (James Raynard)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: How do I encrypt a password in a sh script
Date: 29 Jun 1996 00:54:24 -0000
Organization: A FreeBSD Box
Lines: 22
Message-ID: <4r1us0$1l0@jraynard.demon.co.uk>
References: <31d42659.26716616@news.hq.af.mil>
NNTP-Posting-Host: localhost
X-NNTP-Posting-Host: jraynard.demon.co.uk

In article <31d42659.26716616@news.hq.af.mil>,
Scott Gregory <sgregory@pubspo.hq.af.mil> 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:
[snip]
>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. 

Root can read any file, so 'chmod a-r' is a simple way to keep prying
eyes out.

If you meant encrypting the password on its way over the network,
there isn't any way to do this with FTP that I know of. If you install
ssh from the ports, it includes a program called 'scp' that will
encrypt not only the password, but also the data!

-- 
James Raynard, Edinburgh, Scotland
james@jraynard.demon.co.uk
http://www.freebsd.org/~jraynard/