FTP : refused to connect problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP : refused to connect problem
# 1  
Old 07-12-2012
FTP : refused to connect problem

Hi all,
I have just started learning shell scripting. Im using Ksh.

Here is the problem.
I want to ftp all csv files in a directory from windows to a directory in unix.
the script i wrote is below:
Code:
HOST='IP address'
USER='abcd'
PASSWD='****'
ftp -n $HOST <<END_INPUT
user $USER $PASSWD
cd Z:\dir A\dir B
lcd my destination directory
binary
mget *.csv
quit
END_INPUT

the source file is in network drive Z: under directory B
when i execute this script it refuses to connect.

What is wrong with this script.

Any help appreciated. Thanks in advance

Last edited by Franklin52; 07-12-2012 at 05:02 PM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Old 07-12-2012
In what way does it 'refuse to connect'?

What exactly does it do?

Show what happens word for word, letter for letter, keystroke for keystroke.
# 3  
Old 07-13-2012
@Corona688

This is the reply i get:
Code:
 
ftp: connect: Connection refused
Not connected.
Not connected.
Local directory now /my destination directory
Not connected.
Not connected.

# 4  
Old 07-13-2012
Quote:
Originally Posted by Jayaraman
@Corona688

This is the reply i get:
Code:
 
ftp: connect: Connection refused
Not connected.
Not connected.
Local directory now /my destination directory
Not connected.
Not connected.

are you sure the ftp server is running or maybe firewall disabled or accessable ??
Code:
# telnet $HOST 21
# nc -z $HOST 20-100


Last edited by ygemici; 07-13-2012 at 05:16 AM..
# 5  
Old 07-13-2012
@ygemici

Thanks for the commands.
i tried them both and first one alone worked.
It is not getting connected actually

This is the reply i got

Code:
 
$ telnet IP address
Trying IP address...
telnet: connect to address IP address: Connection timed out
telnet: Unable to connect to remote host: Connection timed out

Does this mean that either ftp server is disabled in windows or the firewall is not allowing the connection to establish
Am i right?

Last edited by Jayaraman; 07-13-2012 at 09:17 AM.. Reason: left the reply incomplete
# 6  
Old 07-13-2012
I assume you tried the valid IP Address if that is correct,that is to say probably that your access is not allowed..check the the windows firewall or check the local firewall in unix

windows
Code:
NET START|find /i "Firewall"

linux
Code:
# service iptables status

unix
Code:
# iptables -L

and what is your O.S ?

Last edited by ygemici; 07-13-2012 at 09:56 AM..
# 7  
Old 07-13-2012
@ygemici
Im using Windows XP and GNU/Linux as the unix counterpart.

I executed the linux command and seems like the local firewall is allowing ftp
the out put of the command is below:

Code:
$ ftp ipltables status
ipltables: bad port number-- status
usage: ftp host-name [port]
ftp>

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

SSHd is running, but cant connect "Network error: Connection refused"

Hi, i checked on rhel VPS is running sshd (service ssh status) But i cant connect via putty: "Network error: Connection refused" Please which log file in my centos rhel linux i need to watch or what are steps to do to discover cause? (3 Replies)
Discussion started by: postcd
3 Replies

2. Shell Programming and Scripting

FTP connection refused issue

Hi All, I am using the below script to get some files from the remote location HOST='Test03' USER='root' PASSWD='*****' FILE='/home/user/d.txt' ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD get $FILE quit END_SCRIPT exit 0 But ist is giving me the... (3 Replies)
Discussion started by: sharsour
3 Replies

3. Shell Programming and Scripting

FTP connection refused

Hi I am trying to execute a shell script which is in unix server gs1. The script is below which basically connects to another unix server q15 and tries to get a file using FTP . But i get error as "ftp: connect: Connection refused Not connected. Not connected." Please help with if the below... (8 Replies)
Discussion started by: samrat dutta
8 Replies

4. AIX

FTP connection refused from text editor while accessing AIX server .

HI , I'm facing the FTP connection refused from text editor while accessing AIX server .It showing the messege "can't create ftp connection connectin refused".Though it is accessible from putty . i'm using aix version 6 . Can any one let me know the seetings needs to be made so that i... (2 Replies)
Discussion started by: rmkganesh
2 Replies

5. Debian

ftp connection refused

I have two computers running Debian 6.0 and one running Solaris 2.6 on a private network. The Debian computers can ftp to the Solaris computer but if a Debian computer is the destination the ftp connection is refused. I assume this is some security feature of Debian. What can I do to allow... (2 Replies)
Discussion started by: snorkack59
2 Replies

6. Solaris

ftp connect connection refused solaris 11

hi, I am using solaris 11 , facing problem in ftp while using ftp to connect it from other os. SCP and ssh are working fine. sftp also working from other solaris machine but i want to ftp from windows os which show me the below message. ftp connect connection refused I use below command... (3 Replies)
Discussion started by: zeeshan047
3 Replies

7. UNIX for Advanced & Expert Users

ftp connection refused

Hi- While trying ftp from AIX to Windows im getting below error. Can anyone share ur views on this topic. root@AB101# ftp -n 10.192.168.68 ftp: connect: A remote host refused an attempted connect operation. ftp> Thanks. (3 Replies)
Discussion started by: yanis
3 Replies

8. AIX

ftp connect in passive mode , ftp settings

how to connect to ftp server in passive mode? ftp server.abc and how can i see ftp settings, doesn't exist some ftpd.conf there is some other file where i check the options and configurations of ftp server? Thanks (3 Replies)
Discussion started by: prpkrk
3 Replies

9. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

10. Shell Programming and Scripting

Connection refused to ftp from a unix server to a windows pc

I need your help please. In order to run a script after a ftp connection, ive got initially this problem: from unix pc machine to a Unix server i could ftp succesfully but in reverse (i mean from unix to pc machine i cant ftp. The error message is this ftp 192.168.29.90 ftp: connect: Connection... (1 Reply)
Discussion started by: alexcol
1 Replies
Login or Register to Ask a Question