Configure to allow anonymous users to log in to access the vsftpd service, upload and download documents, create and delete documents, etc.

  1. It is verified under the centos7 version system.

  2. Under normal circumstances, the upload and download of anonymous users, the users used are the permissions of the ftp user; if you want to upload a file, you need the ftp user to have the w permission to the file, and to download, you need the ftp user to have the r permission to the file permissions.

  3. step

    1. Modify the configuration file vsftpd.conf (configure as needed)
      # vim /etc/vsftpd/vsftpd.conf
          anonymous_enable=YES #Whether anonymous users are allowed to log
          in write_enable=YES #enable any form of FTP write command
          anon_upload_enable=YES #Whether anonymous users are allowed to upload File
          anon_mkdir_write_enable=YES #Whether anonymous users are allowed to create directories
          anon_other_write_enable=YES #Whether anonymous users are allowed to delete, rename, etc.
          anon_umask=022 #Permission mask, the default permission mask when anonymous users upload documents; the folder permission is 777- 022=755, the general file permission is 666-022=644; the default permission mask is 077, the folder permission is 700 after the anonymous user uploads, and the file permission is 600.
          anon_world_readable_only=YES #When it is YES, the other user of the file must have r permission to be allowed to download, even if the owner of the file is ftp and has r permission to the file, it cannot be downloaded. For security reasons, the default is YES; when it is NO , as long as the owner is ftp and has r permission to the file, it can be downloaded;

    2. Set permissions on directories that allow anonymous users to access
          # mkdir /var/ftp/software #Create a new folder for anonymous users to upload and download (optional)
          # chmod o=rwx /var/ftp/software 

    3. Be careful to avoid the impact of SElinux on user access.
      Modify the sebool value
          # setsebool -P ftpd_anon_write on
      to modify the security context
          # chcon -t public_content_rw_t /var/ftp/software/ If
      these settings are too troublesome, you can simply close selinux directly
          # setenforce 0

  4. Replenish

    1. Basic permissions for documents (folders and files):
      r: readable
      w: writable
      x: executable

    2. Ownership of documents (folders and files):
      Owner
      belongs to group
      Others


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324481530&siteId=291194637