FTP Error Please log in with USER and PASS first.

linux ftp script that upload files to an local server behind the same firewall, works fine manually but when the script is ran i get the following error  Please log in with USER and PASS first. getting error passive mode refused.


ftp -n -i -p test-ts <<END
user username password
jamar49Asked:
Who is Participating?
 
dfkeCommented:
Hi,

usually, ftp command line clients support the configuration file ~/.netrc. There you can configure credentials for remote systems, e.g.:

machine ftp.somesystem.org
login username
password blablabla

When you ftp.somesystem.org then you don't have to retype this information anymore.

Cheers
0
 
Duncan RoeSoftware DeveloperCommented:
ftp -n -i -p test-ts <<END
-n here specifically disables use of .netrc.
I have found I always need to write expect scripts to drive ftp. The documentation contains an example script to drive ftp (or it used to, if not then post back and I can post an example).
0
 
murugesandinsC C++ Shell script AIX CYGWIN_NT HP-UX Linux MINGW SunOSCommented:
Forced accept if inactive for 14 days.
0
 
dfkeCommented:
Hi,

Using  ~/.netrc will solve this issue with the reminder that Duncan Roe gave that -n here specifically disables use of .netrc.

Cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.