A program called expect can do the job.
Use http://www.linuxlots.com/~
Main Topics
Browse All Topicsi am trying to use FTP in an shell script.
i created a following program
#!/bin/sh
HOST='172.29.32.202'
USER='oracle'
PASSWD='syntel_123'
FILE='file.txt'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0
I have also tried creating the file .netrc
machine MCK_SRV_2
login oracle
password syntel_123
but still it gives the same error.
Thanks in advance
Regards
manish
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
A program called expect can do the job.
Use http://www.linuxlots.com/~
The problem here is that one end of the FTP connection is using a Kerberized tool. My guess would be that it is the local machine that has a Kerberized ftp client. That will happen if the OS install was "Everything". The solution is to remove the Kerberos package that includes the ftp client that won't work except from within a Kerberos environment.
What does 'rpm -q --whatprovides /usr/bin/ftp' and 'rpm -qa | grep krb' return/
I have the same problem. After installing Red Hat Fedora Core 2 "Everything", not I cannot connect to a local machine in the same network. This is what happens:
[root@copia-linux beatinger]# ftp 10.1.252.196
Connected to 10.1.252.196.
220 GlobalSCAPE Secure FTP Server (v. 3.0)
500 Protocol not supported.
500 Protocol not supported.
KERBEROS_V4 rejected as an authentication type
Name (10.1.252.196:root): download
331 Password required for download.
Password:
230-Login OK. Proceed.
230 Eden Hosting DOWNLOAD Area.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd Linux
550 Permission denied.
ftp> dir
227 Entering Passive Mode (10,1,252,196,109,140).
550 Permission denied.
I desparately need to be able to connect to the FTP server to retrieve RPMs I need to install. How can this be fixed?
Business Accounts
Answer for Membership
by: SkegePosted on 2005-07-06 at 01:28:23ID: 14375679
Hello manishfromuk,
Try to change the ftp part:
ftp -n <<EOF
open 172.29.32.202
user oracle pass syntel_123
put $FILE
EOF
I dont know if this helps, but you can test :)
BR.
Lauri