How does the FTP service lock a common user in his/her home directory?

Source: Internet
Author: User

1. Before using the FTP service, you must install the required packages: FTP, lftp, and vsftpd.

2. Yum-y install FTP lftp (the yum repository is omitted here)

3. Yum-y install vsftpd (main configuration file:/etc/vsftpd. conf)

4. After the service is installed, we can use some users in/etc/passwd/. What do you find when lftp is locally deployed?




No! Why ???

Is The SELinux policy. We can adjust the bool value to allow normal users to log on to the home directory.

Setsebool-P ftp_home_dir 1

Through getsebool-A | grep FTP, you can see that the ftp_home_dir option is on, which means that my normal users can access their home directories. But it is not safe enough. I can return to the root (CD ..)

You only need to change the configuration file.

Vim/etc/vsftpd. conf

Just remove the comments starting with chroot_local_user = yes.


This article is from the "kingj" blog and will not be reproduced!

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.