Enable the vsftpd port under iptables Firewall

Source: Internet
Author: User
Tags ftp protocol

Enable the vsftpd port under iptables Firewall

After enabling the vsftpd port, you can use a client tool to log on, but cannot browse files or create new files. now I checked the ftp protocol and found that ftp has active and passive modes. enabling port 21 on the server end is to allow the client to come in, but there is no outgoing port, the port opened on the server end is also added to the ftp module, the entire operation is a bit complicated, write it down today and deepen your impressions.

-------------------------------------- Split line --------------------------------------

Four Advanced configurations of vsftpd Server:

VsFTPd configuration Tutorial:

Simple and practical Ubuntu FTP setup

Set up FTP server and Apache server on Ubuntu

Install the LAMP \ vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04

Simple case of anonymous uploading of SeLinux and vsftpd on the RHEL6 Platform

Install vsftpd source code in Linux

Case study of vsftpd Security Configuration

-------------------------------------- Split line --------------------------------------

1. Install vsftpd Software

Yum install vsftpd-y

2. enable Anonymous Access and passive mode ports

Vim/etc/vsftpd. conf

Anonymous_enable = YES -- enable Anonymous user access

Anon_upload_enable = YES -- the anonymous user name can upload files.

Anon_mkdir_write_enable = YES -- anonymous users can create files.
Anon_other_write_enable = YES -- anonymous users can rename files.

 

Pasv_enable = YES -- enable Passive Mode
Pasv_min_port = 30000 -- minimum port in passive mode
Pasv_max_port = 31000 -- maximum port in passive mode

3. Load the ftp Module

Vim/etc/modprobe. d/vsftpd. conf

Alias ip_conntrack ip_conntrack_ftp ip_nat_ftp -- load the ftp Module

Vim/etc/rc. local

/Sbin/modprobe ip_conntract -- boot Module
/Sbin/modprobe ip_conntrack_ftp
/Sbin/modprobe ip_nat_ftp

4. Port Filtering

Vim/etc/sysconfig/iptables

-A input-p tcp-m multiport -- dport 20, 21-m state -- state NEW-j ACCEPT -- enable port 20 and port 21
-A input-p tcp-m state -- state NEW-m tcp -- dport 21-j ACCEPT -- enable the 21 active port
-A input-p tcp -- dport 30000: 31000-j ACCEPT -- enable passive Port

5. login Test

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.