LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-24-2007, 08:33 PM   #1
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Rep: Reputation: 30
can connect but not list files - vsftp


I'm using a slackware 11 box, trying to connect from outside my network through my router. I have port 77 on the router forwarded to port 21 on my server, and ports 7777-8000 allowed through the router. In vsftpd.conf I have the 2 lines
Code:
pasv_min_port=7777
pasv_max_port=8000
at the end.
I have tried it with and without my external ip in the "pasv_address=" line.

When I try to connect, it connects and shows me at /home/epoo, but just says "working" when trying to list the files. If I do a netstat -tpan I see:
Code:
tcp        0      0 192.168.0.100:7940      0.0.0.0:*               LISTEN     2157/vsftpd
tcp        0      0 192.168.0.100:7950      0.0.0.0:*               LISTEN     2160/vsftpd
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN     2138/inetd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     1581/sshd
tcp        0    300 192.168.0.100:22        165.234.90.3:39175      ESTABLISHED2050/sshd: epoo [p
tcp        0      0 192.168.0.100:21        165.234.90.3:49650      ESTABLISHED2160/vsftpd
I'm connected remotely through ssh, hence the ssh connection.
What am I doing wrong?
 
Old 05-24-2007, 08:41 PM   #2
jeenam
Member
 
Registered: Dec 2006
Distribution: Slackware 11
Posts: 144

Rep: Reputation: 15
Is your ftp client set to PASV mode?
 
Old 05-24-2007, 08:57 PM   #3
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Original Poster
Rep: Reputation: 30
Yes. I'm using the fireftp firefox add-on.
Code:
FireFTP 0.96.4 'Loomer', created by Mime Čuvalo
220 (vsFTPd 2.0.5)
       USER epoo
331 Please specify the password.
       PASS (password not shown)
230 Login successful.
       FEAT
211-Features:
EPRT
EPSV
MDTM
PASV
REST STREAM
SIZE
TVFS
211 End
       PWD
257 "/home/epoo"
       TYPE A
200 Switching to ASCII mode.
       PASV
227 Entering Passive Mode (24,111,51,224,31,45)
       LIST
Then it just says "working..." and times out.
 
Old 05-25-2007, 06:04 PM   #4
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Original Poster
Rep: Reputation: 30
Anyone else ?
 
Old 05-26-2007, 02:23 AM   #5
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 237
Blog Entries: 1

Rep: Reputation: 34
Check this, it may help you.
Link : http://slacksite.com/other/ftp.html

Quote:
From the server-side firewall's standpoint, to support passive mode FTP the following communication channels need to be opened:

* FTP server's port 21 from anywhere (Client initiates connection)
* FTP server's port 21 to ports > 1023 (Server responds to client's control port)
* FTP server's ports > 1023 from anywhere (Client initiates data connection to random port specified by server)
* FTP server's ports > 1023 to remote ports > 1023 (Server sends ACKs (and data) to client's data port)
If problem still persist,
1. Remove all restrictions from router and test.
2. Directly route port 21 from router to Server and test.

Update us with your findings.
 
Old 06-05-2007, 01:14 PM   #6
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Original Poster
Rep: Reputation: 30
I appreciate your response.
The router's port 77 is forwarded to the server's port 21. The vsftp server setup uses the passive ports 7777-8000, which are forwarded to the server from the router. All ports are allowed to exit from the server to the internet. I just added another rule for 1023-65535 to be allowed to the server, but I'm not sure that will change anything since I already had the passive ports allowed before.
 
Old 06-05-2007, 07:46 PM   #7
epoo
Member
 
Registered: Aug 2003
Distribution: slackware 11, ubuntu 7.04
Posts: 165

Original Poster
Rep: Reputation: 30
Well, it looks like that did it. I thought I would only need to allow 7777-8000, but it didn't work until I allowed 1023-65535.

Now another question. Isn't it terribly insecure to forward all those ports to my server ? Is there a way to set up iptables to only allow the connection to the ftp server, or do I have to allow all those ports ?
 
Old 06-07-2007, 09:43 AM   #8
jeenam
Member
 
Registered: Dec 2006
Distribution: Slackware 11
Posts: 144

Rep: Reputation: 15
Seems the pasv port range of 7777-8000 are not being allowed through your router properly. The pasv_min and pasv_max settings do work properly and I have configured numerous ftp servers using that configuration. Is iptables configured on the ftp server? Perhaps the ports need to be allowed by iptables.

Try adding these to your configuration as well:

pasv_addr_resolve=YES
pasv_address=any.address.you.like
pasv_promiscuous=YES

Last edited by jeenam; 06-07-2007 at 09:52 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
VSFTP - uploaded files get scrambled indoorman Linux - Networking 2 03-12-2007 11:33 AM
weird IP trying to connect my vsftp max_tcs Linux - Security 2 01-07-2005 10:25 AM
Need Vsftp To Use Multiple .conf Files Goma_2 Linux - Networking 0 06-09-2004 09:07 AM
vsftp - allows connect but not writing legendaryfox Linux - Software 6 05-30-2004 02:09 PM
vsftp - locking files? amanu1 Linux - Software 1 11-15-2003 07:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:53 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