解決ftp沒法鏈接登陸linux的辦法

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, 而後重啓

相關文章
相關標籤/搜索