Install and configure FTP service in CentOS

  

Find the name of the ftp service package:
$ yum search vsftpd

Install ftp service:
$ sudo yum install vsftpd.x86_64

View service status:< Br>$ sudo chkconfig --list |  Grep vsftpd

Open the service:
$ sudo chkconfig vsftpd on

Confirm whether it is open:
$ sudo chkconfig --list |  Grep vsftpd

Startup Service:
$ sudo /sbin/service vsftpd start

Configuration File:
$ sudo vim /etc/vsftpd/vsftpd.conf

  1. Close anonymous login: anonymous_enable =YES to anonymous_enable=NO
  2. Ensure that you can read and write your own directory local_enable=yes, write_enable=yes,local_umask=022
  3. Anonymous upload and download anonymous_enable=yes,anon_upload_enable=yes,anon_mkdir_write_enable =yes,anon_umask=022

    Add ftp users:
    $ sudo /usr/sbin/adduser -d /opt/ftp_user_home_dir -g ftp -s /sbin/nologin ftp_user

    - d /opt/ftp_user_home_dir: Specifies the home directory of the user ftp -g ftp: the specified user belongs to the ftp group -s /sbin/nologin: cannot log in to the server ftp_user: username

    Change the password of the FTP user:
    $ sudo passwd ftp_user

    Test FTP user login: Linux/Unix/Mac:
    $ ftp ftp_username@ftp_host

Copyright © Windows knowledge All Rights Reserved