LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-08-2012, 02:46 PM   #1
jjjj12212
LQ Newbie
 
Registered: Feb 2012
Posts: 16

Rep: Reputation: Disabled
Talking vsftpd with port 2021 not going to passive mode


Hi guys,

I setup a ftp server (vsftpd) with an unusual port like 2021.
I know when I use port 21, it works like a charm with passive mode but we cannot use it since its already being in use.

I can ftp it locally noproblem using port 2021 but when I am outside my firewall, I can login no problem but I cannot get a list of directories or anything unless I disable passive. how can I resolve this so it will use passive mode?

thanks guys,
jjjj12212
 
Old 02-08-2012, 02:54 PM   #2
Harlin
Member
 
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316

Rep: Reputation: 38
What do your firewall settings look like? Is 2021 open on the firewall? Also keep in mind there are some caveats to setting up FTP that may not go as smoothly as say opening up a port for SSH<22>. Have a look here: http://forums.fedoraforum.org/showthread.php?t=252087 especially the data port error.

There's also this to consider <ripped from a post off LQ :-D >

Q) Help! Can I change the port that vsftpd runs on?

A1) Yes. If you are running vsftpd in standalone mode, use the "listen_port"
directive in vsftpd.conf.

A2) Yes. If you are running vsftpd from an inetd or xinetd program, this
becomes an inetd or xinetd problem. You must change the inetd or xinetd
configuration files (perhaps /etc/inetd.conf or /etc/xinetd.d/vsftpd)

What kind of errors exactly are you seeing?
 
Old 02-08-2012, 06:56 PM   #3
jjjj12212
LQ Newbie
 
Registered: Feb 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
My firewall setting is Open port 2021 to IP 10.X.X.X
I also did for a test: Open port 2021 then translate it to port 21 to IP 10.x.x.x, same results

vsftpd is on standalone. (listen=YES)
SELinux is disabled.

I can connect to the FTP no problem (ask user/password)
but if I enter any command like ls, it will say : Passive mode (IP,NUMBERS,EXAMPLE)
then it will hang for about 2-5 minutes then say connection timeout.

I will try out the Min_port / max_port and open those on my router tomorrow

good night,
jjjj12212
 
Old 02-09-2012, 02:02 PM   #4
jjjj12212
LQ Newbie
 
Registered: Feb 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
ok so I setup with this:

listen=YES
listen_port=2021
pasv_min_port=65000
pasv_max_port=65535
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
#connect_from_port_20=NO
#ftp_data_port=2020
syslog_enable=YES

my firewall open ports are 2020-2022 and 65000-65535 and still no luck.
I get login, I login no problem. but when I do a command like ls, it says passive bla bla bla and hangs, no results

thanks,
jjjj12212
 
Old 02-09-2012, 04:28 PM   #5
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
That's all right, but what does your Firewall do ?
Try stopping it and connect to see if FTP works (mostly it does) then restart FW again and make modifications to allow Passive ports.

good luck
 
Old 02-13-2012, 12:51 PM   #6
jjjj12212
LQ Newbie
 
Registered: Feb 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
sorry for the delay,

I have done service iptables stop

then got:

iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]

so I tried it again and still the same thing
 
Old 02-13-2012, 01:14 PM   #7
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by jjjj12212 View Post
My firewall setting is Open port 2021 to IP 10.X.X.X
I also did for a test: Open port 2021 then translate it to port 21 to IP 10.x.x.x, same results

......

I'm sorry, but after reading the above, it occured to me that it won't work, because NAT some port to IP with Passive FTP doesn't work. I tried it, people here on forum also tried, but no success unfortunately.
Your FTP server will have to be in DMZ zone or direct on the internet to work.
 
  


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
VSFTPD question...active/passive mode lapzlinux Linux - Networking 4 08-06-2011 01:54 AM
vsftpd - Passive mode not working correctly. Zaraphrax Linux - Software 1 02-17-2011 04:23 AM
How can I configure vsftpd to accept passive mode? daihard Linux - Server 1 09-04-2009 05:30 PM
Vsftpd Entering passive mode pramka SUSE / openSUSE 1 07-18-2008 07:20 PM
Problem with vsftpd and passive mode 0001001 Linux - Server 1 09-12-2006 07:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:52 AM.

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