Simple case of anonymous uploading of SeLinux and vsftpd on the RHEL6 Platform

Source: Internet
Author: User
SeLinux is rarely enabled for FTP applications on most production lines on the RHEL6 platform, because it is too troublesome. Here is a small case, based on the RHEL6.3 platform. System status: RedHadEnterprisesLinux6.332bitSeLinux-Enforcingiptables-disabled-

SeLinux is rarely enabled for FTP applications on most production lines on the RHEL6 platform, because it is too troublesome. Here is a small case, based on the RHEL 6.3 platform.

System status:

RedHad ipvises Linux 6.3 32bit

SeLinux-Enforcing

Iptables-disabled)

1. Installation omitted (yum-y install vsftpd)

2. Start and test by default

After the installation, vsftpd is directly started without modifying any parameters. Common users can log on and upload and download the vsftp, which is the default situation of vsftp, however, SeLinux is not so default. Enable:

[Root @ localhost cto.luxiaok.com] # setsebool-P ftp_home_dir = on

Otherwise, the error 500 indicating that the directory cannot be switched will be reported. In fact, by default, vsftp allows local users to log on and upload/download is dangerous, because it can be switched to another directory, of course, by default. This can also be controlled through vsftpd. conf.

3. Enable upload/download for anonymous users

This is the topic of this article. Let's talk about the default situation. By default, vsftpd. conf can be modified only when anonymous users are allowed to log on and download, but not upload.

Allow Anonymous upload settings:

Cancel the comments from the above two lines and restart vsftpd. You can also comment out local_enable to disable local user login.

However, you still cannot upload the file.

First

Root@luxiaok.com ~ # Chmod-R 777/var/ftp/pub

It is very important that the permissions of/var/ftp cannot be changed here. Otherwise, the 500 error will occur directly when anonymous users log on. This is the default mechanism of vsftp. The upload here takes the pub directory as an example.

Then

[Root @ localhost cto.luxiaok.com] # setsebool-P allow_ftpd_anon_write = on

Then perform the test.

Here is a very simple case, but I will explain more about SeLinux.

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

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.