加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Linux下ftp无法登录的情况如何解决

发布时间:2023-06-03 14:07:42 所属栏目:Linux 来源:
导读:在实际应用中,我们有时候会遇到“Linux下ftp登录不了的情况如何解决”这样的问题,我们该怎样来处理呢?下文给大家介绍了解决方法,希望这篇“Linux下ftp登录不了的情况如何解决”文章能帮助大
在实际应用中,我们有时候会遇到“Linux下ftp登录不了的情况如何解决”这样的问题,我们该怎样来处理呢?下文给大家介绍了解决方法,希望这篇“Linux下ftp登录不了的情况如何解决”文章能帮助大家解决问题。
 
方法:1、用“yum -y install vsftpd”安装vsftpd;2、用“chkconfig iptables off”关闭防火墙;3、修改vsftp文件允许root用户登录;4、修改config中disabled模式并重启即可。
 
本教程操作环境:linux7.3系统、Dell G3电脑。
 
1、首先安装vsftpd
 
命令:
 
yum -y install vsftpd
 
之后开启服务:
 
service vsftpd start
 
2、关闭防火墙
 
1) 重启后生效
 
开启:
 
chkconfig iptables on
 
关闭:
 
chkconfig iptables off
 
2) 即时生效,重启后失效
 
开启:
 
service iptables start
 
关闭:
 
service iptables stop
 
3、默认情况下vsftp是不允许root用户登录的,可以通过修改限制来解决这个问题
 
首先找到vsftp的配置目录
 
[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
 
上面这个两个就是默认情况下vsftp不允许使用的账号列表,讲文件中root删除,或者前面加个#号 重启一下vsftpd 服务 即可
 
4、将/etc/selinux/config 中的enforcing 模式改为disabled, 然后重启。
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!