Alibaba Cloud ECS CentOS6 installation FTP (VSFTPD)

Source: Internet
Author: User
Tags iptables

1, installation vsftpd

# Yum Update source

# yum Install vsftpd-y installing VSFTPD server


2, Configuration vsftpd.

# vi/etc/vsftpd/vsftpd.conf Configuration vsftpd master configuration file


Find the following item change or Open #

Anonymous_enable=no Prohibit anonymous access

#ascii_upload_enable allow uploading using ASCII code

#ascii_download_enable allow the use of ASCII code to download

Chroot_list_enable=yes restrict access to directories outside the home directory for FTP users

Chroot_list_file=/etc/vsftpd/chroot_list restrict FTP users from accessing directories outside the home directory user list:


Add the following code at the end to turn on passive mode and better support for FTP tools such as FlashFXP

Pasv_enable=yes

pasv_min_port=20000 #开放的端口

pasv_max_port=20100


Note: Add a sentence at the end of the Local_root=/install will enter this directory, no matter what user login FTP. It seems that the first time the user login will enter the/home/user name directory. After rebooting, we're in the/install directory.


3, configure the firewall, open 21 and other ports

The firewall is configured in/etc/sysconfig/iptables, but centos6x does not have this file. First generate this file

1) Run a iptables firewall rule configuration command at any one:

# iptables-p OUTPUT ACCEPT

2) Save the Iptables service

# Service Iptables Save

3) Restart Iptables service

# Service Iptables Restart


After these three steps,/etc/sysconfig/iptables exists. Then do the following:

# Vi/etc/sysconfig/iptables

Add the following two lines above [commit]

-A input-m state--state new-m tcp-p TCP--dport 21-j ACCEPT open 21 port

-A Input-p TCP--dport 20000:20100-j ACCEPT development Port 20000-20100:

4. Restart the firewall and start the VSFTPD server

Restart Firewall: #service iptables restart

Restart the VSFTPD server: #service vsftpd Start (note that if the VSFTPD is already started, then booting is a failure.) Can be switched off and then restarted)


5. Add FTP User

# adduser-g Ftp-s/sbin/nologin Zhangtao added Zhangtao FTP user

# passwd Zhangtao Set password for Zhangtao


6. Write the added user to Vim/etc/vsftpd/chroot_list

Zhangtao

Can


When you're done, you can access it with FLASHFXP. The directory after landing is/home/zhangtao





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.