Install FTP service under linux centos

  
 As an FTP server, vsftpd is very common in Linux systems; the following describes how to install vsftp on the centos system.
I have already said that Apache, mysql, php, phpmyadmin are installed under Linux.
What is vsftpd
vsftpd is one of the most respected FTP server programs in Linux distributions. Features are small and light, safe and easy to use.
The name of vsftpd stands for "very secure FTP daemon", security is one of the top issues considered by its developer Chris Evans. At the very beginning of this FTP server design and development, high security is a goal.
Install vsftpd
1. Execute the following command as administrator (root)
  • yum install vsftpd

    2. Set boot to start vsftpd ftp service
  • chkconfig Vsftpd on

    3. Start vsftpd service
  • service vsftpd start

    Manage vsftpd related commands:
    Stop vsftpd: service vsftpd stop
    Restart vsftpd: service vsftpd Restart
    Configure the firewall
    Open the /etc/sysconfig/iptables file
  • vi /etc/sysconfig/iptables

    Add the following code before the REJECT line
  • - A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT

    Save and close files, restart the firewall
  • service iptables start

    Configure vsftpd Server
    The default configuration file is /etc/vsftpd/vsftpd.conf, which you can open with a text editor.
  • vi /etc/vsftpd/vsftpd.conf

    Add ftp user
    The following is to add ftpuser user, set the root directory to /home/wwwroot/ftpuser, forbid this user to log in to SSH Permissions and restrict access to other directories.
    1, modify /etc/vsftpd/vsftpd.conf
    will be the next three lines
  • #chroot_list_enable=YES
  • # (default follows)
  • #chroot_list_file =/etc/vsftpd.chroot_list

    Change to
  • chroot_list_enable=YES
  • # (default follows)
  • chroot_list_file=/etc/vsftpd/chroot_list< Br>
    2, increase user ziyouwu, point to the directory /home/wwwroot/ziyouwu, prohibit login SSH permissions.
  • useradd -d /home/wwwroot/ziyouwu -g ftp -s /sbin/nologin ziyouwu

    3. Set user password
  • passwd ziyouwu

    4, edit the file chroot_list:
  • vi /etc/vsftpd/chroot_list

    The content is the ftp user name, each user accounted for one line, such as:
    ziyouwu
    user1
    User2
    6, restart vsftpd
  • service vsftpd restart

    The error occurred
    1,500 OOPS: cannot change directory Solution:
    Enter the command at the terminal:< Br>
  • setsebool -P ftpd_disable_trans 1
  • service vsftpd restart

    It's OK! Reason: This is because the server has selinux enabled, which limits FTP login

  • Copyright © Windows knowledge All Rights Reserved