Home>Article>Operation and Maintenance> What should I do if I can’t log in via ftp in Linux?
Method: 1. Use "yum -y install vsftpd" to install vsftpd; 2. Use "chkconfig iptables off" to turn off the firewall; 3. Modify the vsftp file to allow the root user to log in; 4. Modify the disabled mode in the config and Just restart.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
1. First install vsftpd
Command:
yum -y install vsftpd
Then start the service:
service vsftpd start
2. Turn off the firewall
1) It will take effect after restarting
Open:
chkconfig iptables on
Close:
chkconfig iptables off
2) Effective immediately, invalid after restart
Open:
service iptables start
Close:
service iptables stop
3. By default, vsftp does not allow the root user to log in. This problem can be solved by modifying the restrictions
First find the configuration directory ofvsftp
[root@localhost vsftpd]# pwd /etc/vsftpd [root@localhost vsftpd]# ls chroot_list ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh [root@localhost vsftpd]# 修改 [root@localhost vsftpd]# cat ftpusers # Users that are not allowed to login via ftp #root bin daemon adm lp sync shutdown halt mail news uucp operator games nobody 修改 [root@localhost vsftpd]# cat user_list # vsftpd userlist # If userlist_deny=NO, only allow users in this file # If userlist_deny=YES (default), never allow users in this file, and # do not even prompt for a password. # Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers # for users that are denied. #root bin daemon adm lp sync shutdown halt mail news uucp operator games nobody
The above two are accounts that are not allowed to be used by vsftp by default List, delete the root in the file, or add a # sign in front to restart the vsftpd service
4. Change the enforcing mode in /etc/selinux/config to disabled, and then restart
Recommended learning:Linux video tutorial
The above is the detailed content of What should I do if I can’t log in via ftp in Linux?. For more information, please follow other related articles on the PHP Chinese website!