CentOS installation vsftp and configuring users

Source: Internet
Author: User

First step, install Vsftp

# 1, execute the following command as Administrator (root) yum install vsftpd# 2, set boot vsftpd FTP service chkconfig vsftpd on# 3, start vsftpd service  Service vsftpd start    

Step Two, configure the firewall

# Open/etc/sysconfig/iptables Filevi /etc/sysconfig< Span class= "pun" >/iptables #在REJECT行之前添加如下代码  -a rh-firewall-1-input -m state --state NEW -m TCP -< Span class= "PLN" >p TCP --dport 21 -j accept #保存和关闭文件, restart firewall service iptables restart   

Third, add the FTP user and set the FTP user password

Here is the Add Ftpuser user, set the root directory to/home/wwwroot/ftpuser, prevent this user from logging on to SSH, and restrict access to other directories.

1, modify the/etc/vsftpd/vsftpd.conf, will be the bottom three lines

#chroot_list_enable =yes# (default follows)#chroot_list_file =/etc/vsftpd.chroot_list 

Switch

Chroot_list_enable=YES# (default follows)chroot_list_file=/etc/vsftpd/ chroot_list         

2, add user Ftpuser, point to directory/home/wwwroot/ftpuser, prohibit login SSH permission.

-/home/wwwroot/--/sbin/nologin ftpuser   

3. Set User password

passwd Ftpuser

4, edit the file chroot_list (content is FTP user name, each user occupies one line):

/etc/vsftpd/chroot_list    

Fourth step, enable PASV mode

Pasv_enable=YES         #启用被动模式pasv_min_port=10000#被动模式使用端口范围pasv_max_port= 10010#被动模式使用端口范围         

Fifth step, for the fourth step to open the firewall port, if not enabled PASV mode can be

-A RH-Firewall-1--------10000:10010-J ACCEPT               

An error occurred while connecting to FTP after the above operation was completed

OOPS: vsftpd:' ftp_username ':ftp      

After the network search, get the following solution

Add a line to/etc/vsftpd.conf ftp_username=nobody it's done.

CentOS installation vsftp and configuring users

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.