1, the problem: Vsftp Login Error "Oops:cannot change directory:/home/*******"
Solve:
A, first check the issue of permissions;
B
FTP Server connection failed, error message:
Oops:cannot Change directory:/home/*******
Oops:child died
After the above error occurs, the following methods are used to add two FTP accounts and assign the exclusive FTP account directory:
/usr/sbin/adduser-d/home/ftpname1_dir-g ftp-s/sbin/nologin ftpname1
/usr/sbin/adduser-d/home/ftpname2_dir-g ftp-s/sbin/nologin ftpname2
Modify the Vsftpd.conf profile to add the following line for FTP-specific accounts (multiple FTP accounts separated by commas in English):
Ftp_username=ftpname1,ftpname2
Restart FTP Server Client login FTP found error No, login success, all normal, but the problem again, no RWX permissions on the directory, began to assume that the configuration did not enter into the wrong directory, and then switched to the home root directory after the discovery of other directories can be normal access, Only this exclusive FTP account directory does not have the RWX operation permission, also does not have the error prompt
Later on the Internet to query a lot of methods are said to close the SELinux, but close the selinux after all is not very happy, after all, affect security.
When you encounter the above problem, try to resolve it by entering the following command
(i) [root@ zhaiqutianshangxing vsftpd] #setsebool-P Ftpd_disable_trans 1
[root@ zhaiqutianshangxing vsftpd] #service vsftpd restart
The-p parameter in the first line is for this command to be entered later without requiring each boot
As a result, the problem comes up again, prompting Setsebool is not set??? This command does not succeed and continues with the following second method
(ii) or use the following solutions:
[root@ zhaiqutianshangxing ~]#/usr/sbin/setsebool-p Ftp_home_dir 1
Congratulations, the implementation of success, but unfortunately the problem has not been solved and then encountered the following ideas ~
2, use setsebool-p Ftpd_disable_trans 1//Plus-P to express permanent
Hint Error:
[root@ zhaiqutianshangxing vsftpd]# setsebool-p Ftpd_disable_trans 1
Libsemanage.dbase_llist_set:record not found in the database (No such file or directory).
Libsemanage.dbase_llist_set:could not set record value (No such file or directory).
Could not change Boolean Ftpd_disable_trans
Could not change policy booleans
Workaround:
You may be able to use the following one directly to solve the problem:
[root@ zhaiqutianshangxing ~]#/usr/sbin/setsebool-p ftp_home_dir 1
Try again,
If it's still not working, then use the following complete method:
[root@ zhaiqutianshangxing vsftpd]# setsebool allow_ftpd_full_access 1
[root@ zhaiqutianshangxing vsftpd]# setsebool allow_ftpd_use_cifs 1
[root@ zhaiqutianshangxing vsftpd]# setsebool Allow_ftpd_use_nfs 1
[root@ zhaiqutianshangxing vsftpd]# setsebool-p ftp_home_dir 1
[root@ zhaiqutianshangxing vsftpd]# setsebool httpd_enable_ftp_server 1
[root@ zhaiqutianshangxing vsftpd]# setsebool tftp_anon_write 1
[root@ zhaiqutianshangxing vsftpd]# service vsftpd restart
Close vsftpd:[OK]
Start vsftpd:[OK for VSFTPD]
[root@ zhaiqutianshangxing vsftpd]# getsebool-a | grep FTP
Allow_ftpd_anon_write--> off
Allow_ftpd_full_access--> on
Allow_ftpd_use_cifs--> on
Allow_ftpd_use_nfs--> on
Ftp_home_dir--> on
ftpd_connect_db--> off
Httpd_enable_ftp_server--> on
Sftpd_anon_write--> off
Sftpd_enable_homedirs--> off
Sftpd_full_access--> off
Sftpd_write_ssh_home--> off
Tftp_anon_write--> on
Restart VSFTPD, waste a great deal of trouble finally solved, quack, happy.