Paul,
You can (caution, insecure) just create a ~/.netrc file for the
user that is running the ftp script. (man ftp).


machine  machine.somewhere.domain
login    anonymous
password [EMAIL PROTECTED]

You will need a "BLANK LINE" after the password line.

You will also need to chmod 0400 ~/.netrc

Like I said, this is insecure as root can read the file, but it works.
You can replace the anonymous and [EMAIL PROTECTED] with real user/passwords.

Ugly hack:

Down inside your script,

ftp machine.somewhere.domain <<EOF
lcd /dir.on.local.machine
cd /dir/on/remote/machine
put filename.you.want.to.ftp
put another.filename.you.want.to.ftp
bye
EOF

Issue normal ftp commands inside the "here doc" you need.
The ftp inside the script will reference the ~/.netrc and if it
matches the machine.somewhere.domain, will use the login and password
from that file.

(This is for all of us who do not have the abilities to install ssh at
work)

Have fun,
--
Rick L. Mantooth
[EMAIL PROTECTED]
Some people are alive only because it is illegal to kill them.

On Tue, 28 Dec 1999, Paul Crossman wrote:

=> I'm trying to write a shell script where part of the functionality is an
=> ftp.  How can I use ftp or a related utility so that I, or someone else
=> doesn't have to be there to type the password.
=> 
=> I tried
=> 
=> ftp < filename, where filename is a text file that has stuff in it that
=> I would type at the prompts....no go.
=> 
=> I also tried
=> 
=> ftp host.do.main < filename
=> 
=> I can't use anything like rsh or rcp as this is a very secure
=> environment that I'm working in.  Every box is locked down for the most
=> part.  Most of my activities have to be done via ssh.
=> 
=> I haven't tried sftp, but I'm pretty shure that it's not going to work.
=> 
=> Anyone have any suggestions???
=> 
=> Sincerely,
=> Paul C.
=> 
=> 
=> -- 
=> To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
=> as the Subject.
=> 
=> 


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to