LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-24-2017, 11:51 AM   #1
whirlpoolq
LQ Newbie
 
Registered: Feb 2017
Posts: 5

Rep: Reputation: Disabled
FTP : Connection time out


AP Tempe FTP notes using a Linux system
We are just using a .netrc file to connect to the server and a put command to place the files there.
ftp 158.52.2.14
Connected to 158.52.2.14 (158.52.2.14).
220 FTP Server ready.
331 Password required for aptempe.
230 User aptempe logged in.
Remote system type is UNIX.
ftp> ls
227 Entering Passive Mode (158,52,2,14,215,131)
ftp: connect: Connection timed out

And here's where it hangs....
 
Old 02-24-2017, 01:13 PM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
It hangs on entering passive mode, that could be a firewall issue. You have probably opened up the FTP command port (port 20) but the passive port range (data) is most likely still blocked. Are you using iptables, firewalld or a hardware firewall? I'd check there first. I have to admit to forgetting the most secure way of configuring iptables for Passive Ranges, assuming it is iptables or firewalld that is.

Just a note, normal FTP is unencrypted and thus not safe for anything sensitive in anyway. If you need things encrypted I'd use SFTP instead which is the preferred method of transferring files to a Linux Server. Personally I don't like the idea of transmitting passwords in plaintext, something normal FTP will do.

Last edited by r3sistance; 02-24-2017 at 01:16 PM.
 
Old 02-24-2017, 11:58 PM   #3
whirlpoolq
LQ Newbie
 
Registered: Feb 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
FTP command port on serve is 21 and not 20. 20 is thee data port on server when client is in active mode.

SFTP cant be used in this case : .netrc file wont support SFTP.

Firewall issue : Not very sure becuase we have 100s of clients sending files through FTP to our server. Facing issue with this client only.

We are not using iptables, only firewall with NAT.

Last edited by whirlpoolq; 02-25-2017 at 12:01 AM.
 
Old 02-25-2017, 12:34 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by whirlpoolq View Post
.netrc file wont support SFTP.
No, but SFTP does support a batch mode when using keys.
 
Old 02-25-2017, 12:37 AM   #5
whirlpoolq
LQ Newbie
 
Registered: Feb 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
can you elaborate?
 
Old 02-25-2017, 12:39 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Yes, you can set up SFTP to authenticate using keys, as per established best practice. Then you can load the SFTP commands you want into a text file and read them into the SFTP client using the -b option. Again this only works with keys, but also again keys are the established best practice.
 
1 members found this post helpful.
Old 02-25-2017, 12:41 AM   #7
whirlpoolq
LQ Newbie
 
Registered: Feb 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
See here i cant make any changes. Becuase people who are establishing FTP connection with us are our clients and they said they wont be using SFTP.

And they are not ready to change anything on their side.

Any help on this existing issue would be much appreciated.
 
Old 02-25-2017, 04:01 PM   #8
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by whirlpoolq View Post
See here i cant make any changes. Becuase people who are establishing FTP connection with us are our clients and they said they wont be using SFTP.

And they are not ready to change anything on their side.

Any help on this existing issue would be much appreciated.
It still could be firewall, if it only one client then it could be THEIR firewall. I did make a mistake on the port but you failure is at the point of creating a passive connection and so still indicate it'd be firewall related since the data connection isn't being made.
 
Old 02-26-2017, 01:21 AM   #9
whirlpoolq
LQ Newbie
 
Registered: Feb 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
you know the tricky part is they are able to send the data to our test servers but not to production server. And, in case of passive mode i dont think client firewall has any role to play.ALso, client is able to send files through filezilla but not through Linux .netrc file.

Last edited by whirlpoolq; 02-26-2017 at 02:02 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection Destroy Time with Net Filter Connection Tracking Washington Ratso Linux - Networking 3 05-15-2011 02:51 PM
Recoonect ftp without exiting ftp connection ! shipon_97 Linux - Newbie 1 05-05-2009 05:58 AM
Long time reader, first time poster (LTR FTP) sirlancealot LinuxQuestions.org Member Intro 1 03-10-2008 06:59 PM
time on our RH linux FTP server is four hours ahead, but desktop time is correct?? dgr Linux - Newbie 10 10-09-2007 05:42 AM
Time out in Connection established state if no Data flows on that connection asurya Linux - Networking 2 04-10-2005 03:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration