Linux FTP connection times is wrong, unable to switch to home directory (cannot change directory)

Source: Internet
Author: User
Tags ftp connection

Access prompts the following error:
Oops:cannot Change Directory:/home/ftp
The reason is that his CentOS system installed SELinux, because the default is not open FTP support, so access is blocked.
View SELinux Settings

The code is as follows Copy Code
# Getsebool-a|grep FTP
Ftpd_disable_trans--> off

Or

The code is as follows Copy Code
Ftp_home_dir-->off

Workaround:
Use the Setsebool command to open

The code is as follows Copy Code
# Setsebool Ftpd_disable_trans 1

Or

The code is as follows Copy Code
# Setsebool Ftp_home_dir 1

To see whether the current state is on state again

The code is as follows Copy Code
# Getsebool-a|grep FTP
Ftpd_disable_trans--> on

Or

The code is as follows Copy Code
Ftp_home_dir-->on

Setsebool use the-p parameter without having to enter this command every time the boot is turned on

The code is as follows Copy Code
# setsebool-p Ftpd_disable_trans 1

Or

The code is as follows Copy Code
# setsebool-p Ftp_home_dir 1
# Service VSFTPD Restart

About the configuration of SELinux
such as off, just warning, coercion, etc. need to edit/etc/sysconfig/selinux default is mandatory

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.