이 콘텐츠는 선택한 언어로 제공되지 않습니다.

2.2.6.2. Anonymous Access


The presence of the /var/ftp/ directory activates the anonymous account.
The easiest way to create this directory is to install the vsftpd package. This package establishes a directory tree for anonymous users and configures the permissions on directories to read-only for anonymous users.
By default the anonymous user cannot write to any directories.

Warning

If enabling anonymous access to an FTP server, be aware of where sensitive data is stored.

Procedure 2.1. Anonymous Upload

  1. To allow anonymous users to upload files, it is recommended to create a write-only directory within the /var/ftp/pub/ directory. Run the following command as root to create such directory named /upload/:
    ~]# mkdir /var/ftp/pub/upload
  2. Next, change the permissions so that anonymous users cannot view the contents of the directory:
    ~]# chmod 730 /var/ftp/pub/upload
    A long format listing of the directory should look like this:
    ~]# ls -ld /var/ftp/pub/upload
    drwx-wx---. 2 root ftp 4096 Nov 14 22:57 /var/ftp/pub/upload

    Note

    Administrators who allow anonymous users to read and write in directories often find that their servers become a repository of stolen software.
  3. Under vsftpd, add the following line to the /etc/vsftpd/vsftpd.conf file:
    anon_upload_enable=YES
  4. In Red Hat Enterprise Linux, the SELinux is running in Enforcing mode by default. Therefore, the allow_ftpd_anon_write Boolean must be enabled in order to allow vsftpd to upload files:
    ~]# setsebool -P allow_ftpd_anon_write=1
  5. Label the /upload/ directory and its files with the public_content_rw_t SELinux context:
    ~]# semanage fcontext -a -t public_content_rw_t '/var/ftp/pub/upload(/.*)'

    Note

    The semanage utility is provided by the policycoreutils-python package, which is not installed by default. To install it, use the following command as root:
    ~]# yum install policycoreutils-python
  6. Use the restorecon utility to change the type of /upload/ and its files:
    ~]# restorecon -R -v /var/ftp/pub/upload
    The directory is now properly labeled with public_content_rw_t so that SELinux in Enforcing mode allows anonymous users to upload files to it:
    ~]$ ls -dZ /var/ftp/pub/upload
    drwx-wx---. root root unconfined_u:object_r:public_content_t:s0 /var/ftp/pub/upload/
    
    For further information about using SELinux, see the Security-Enhanced Linux User Guide and Managing Confined Services guides.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.