In linux, linuxftp cannot view the file list.
After ftp is configured on the linux server today, logon is normal. After ftp is used to log on, all directories can be accessed by manually writing paths, but no data is visible to folders and file lists.
Later, I analyzed the cause and found that the result was related to selinux. So after selinux is disabled, I tried to check the ftp folder and file list normally.
The following two figures show before and after solution:
1. Before resolving the problem, you can enter the correct path to read the access, but the list is not displayed.
2. After the solution is completed, you can view the list data visually.
========================================================== ========================================================== ============
There are three methods to set selinux in Linux.
1. In the graphic interface:
Desktop --> Management --> Security Level and firewall, set to disable.
2. In command mode:
Modify the file:/etc/selinux/config and restart the system. Specific Modification
3. Run the setup command to go to "firewall configuration". In The selinux column, select "Disable".
4. Run the command: setenforce 0 (no need to restart ).
Disable selinux protection for the specified service (using ftp as an example ):
1. Run the getsebool ftpd_disable_trans command to check the current status if it is not on
2. Enter the command: setsebool ftpd_disable_trans 1
Of course, you can also add the-P Parameter so that you do not need to enter this command every time you start the system.
Setsebool-P ftpd_disable_trans 1
As for the role of selinux, I will not elaborate on it here. You can just take a look At Baidu.
Log on to linux ftp and cannot see files
Switch to passive mode and disable selinux
The folder created in linux cannot be seen after FTP login
Is selinux enabled? If yes, you must set the security context to be recognized by vsftpd.
We recommend that you disable selinux!