LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-05-2012, 11:21 PM   #1
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Rep: Reputation: 2
Question vsftpd server is not working through web browser


Hi everybody....I need your help about my vsftpd server.

I have installed vsftpd server in my web server and it's behind a firewall too. When I connect to my ftp server through command line is working for me but it's not working when i am trying to connect through my web browser (Mozilla).

In my firewall i added this rules in my iptables configuration:

/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack_ftp
iptables -t nat -A PREROUTING -p tcp -d ip_public --dport 21440 -j DNAT --to webserver_address:21440.

I changed my ftp port to 21440. Please help me as soon as possible.
 
Old 03-05-2012, 11:51 PM   #2
elfenlied
Member
 
Registered: Dec 2004
Posts: 83

Rep: Reputation: 8
Do you get some kind of error? That might give you a hint as to why its failing.

Also can you show us the output of the following "iptables -L -n" and "netstat -apn | grep -i listen | grep tcp"

Last edited by elfenlied; 03-05-2012 at 11:56 PM.
 
Old 03-06-2012, 12:59 AM   #3
shamantony
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Rep: Reputation: Disabled
Please let me know what error you are getting while accessing so that I can help you.


ftp://user@ip, this is the way to access ftp via browser

Last edited by shamantony; 03-06-2012 at 01:01 AM.
 
Old 03-06-2012, 01:51 AM   #4
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 shamantony View Post
...
ftp://user@ip, this is the way to access ftp via browser
Except if you allow anonymous access...

@ edeamat

please post the message you get in your browser
and the configuration file of your firewall and vsftpd
you will get more help providing all these settings.
 
Old 03-06-2012, 10:09 AM   #5
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
Hi Lithos,

My FTP Server is listening by port 21440 and it's behind a firewall. My firewall is configured with this rules:

iptables -t nat -A PREROUTING -p tcp -m tcp -d ip_public --dport 21 -j DNAT --to-destination ip_ftp_server:21440
iptables -t nat -A PREROUTING -p tcp -m tcp -d ip_public --dport 30400:30500 -j DNAT --to-destination ip_ftp_server:21440


thank you
Attached Thumbnails
Click image for larger version

Name:	ftp.JPG
Views:	467
Size:	92.4 KB
ID:	9199  
 
Old 03-06-2012, 12:08 PM   #6
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
Hi,

I don't know why would you need to NAT the address of your FTP server (is your firewall server different than FTP ?)
but if I look at the error 425 you get, then take a look here - 425 - failed to establish connection

you might need to add some options to configuration of firewall

from what I see:
Quote:
iptables -t nat -A PREROUTING -p tcp -m tcp -d ip_public --dport 21 -j DNAT --to-destination ip_ftp_server:21440
iptables -t nat -A PREROUTING -p tcp -m tcp -d ip_public --dport 30400:30500 -j DNAT --to-destination ip_ftp_server:21440
this second rule is wrong, it doesn't NAT to Passive ports on your FTP server.
It should be:
Code:
iptables -t nat -A PREROUTING -p tcp -m tcp -d ip_public --dport 30400:30500 -j DNAT --to-destination ip_ftp_server

or maybe
iptables -t nat -A PREROUTING -p tcp -m tcp -d ip_public --dport 30400:30500 -j DNAT --to-destination ip_ftp_server:30400-30500
so the ports 30400-30500 go to your FTP server IP:30400-30500

It's a problem with your wrong NAT-ing in firewall.

Last edited by lithos; 03-06-2012 at 12:10 PM.
 
1 members found this post helpful.
Old 03-06-2012, 12:44 PM   #7
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
Thank you very much for your help Lithos.
 
Old 03-06-2012, 01:24 PM   #8
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
No problem edeamat

you were a good "student" listening to suggestions and you did it.


Regards.

Last edited by lithos; 03-06-2012 at 01:26 PM.
 
Old 03-06-2012, 01:50 PM   #9
edeamat
LQ Newbie
 
Registered: Mar 2009
Location: Lima Peru
Distribution: Centos
Posts: 17

Original Poster
Rep: Reputation: 2
Thanks a lot again Lithos. My FTP server is working for me right now.

Best regards.
 
  


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
launch a web page with vsftpd ftp server Tux Rules Linux - Networking 7 04-14-2011 06:46 PM
ssh with x-server through web browser xc1024 Linux - Software 6 01-05-2009 02:48 PM
vsftpd configuration for web server - newbie adagio Linux - Server 6 08-29-2006 01:05 PM
FTP (vsftpd) and web server (apache) TC10284 Linux - Software 2 07-15-2006 06:14 PM
vsftpd from web browser autonomous_sam Linux - Software 10 03-12-2005 02:28 AM

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

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