Home>Article>Operation and Maintenance> What to do if ftp cannot be accessed in Linux
Two solutions: 1. Use getenforce to check the status of selinux and set the status to a relaxed state. 2. Use "head /var/log/messages" to view the log prompts, run the second line of the operation result in the "/etc/vsftpd/" directory, and then restart the vsftpd service.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
I have heard many friends report that FTP cannot be accessed before. I have also encountered this problem recently. Today I suddenly found that ftp access has been unable to access. Go and check that the username and password are correct. Check that port 21 of the server's FTP server is in the listening state, but suddenly FTP cannot be accessed. HH?
First read the log: head /var/log/messages
FTP cannot enter solution one:
According to the log prompt: It is related to selinux security. You can check the status of selinux at this time:
It can be seen that selinux is in a mandatory state, and we set it to a relaxed state:
[root@linux vsftpd]#setenforce 0
At this point the user can log in normally! problem solved!
FTP cannot enter solution two:
Our selinux is still set to enforce state, run according to the log prompt:
sealert -l 6459724e-821f-4334-8b5c-1ac0d96ea5cb
Run There are 2 lines after the result:
First run the first line:
Then switch to the /etc/vsftpd/ directory and run the second line:
Finally restart the vsftpd service!
[root@master ~]# systemctl restart vsftpd
Test access to ftp login is normal!
Recommended learning:Linux video tutorial
The above is the detailed content of What to do if ftp cannot be accessed in Linux. For more information, please follow other related articles on the PHP Chinese website!