• 解决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, 然后重启

  • 相关阅读:
    Reactor系列(四)subscribe订阅
    Reactor系列(三)创建Flux,Mono(续)
    Reactor系列(二)Flux Mono创建
    Reactor系列(一)基本概念
    Stream系列(十五)File方法使用
    Stream系列(十四)parallet方法使用
    OpenCV二值化、归一化操作
    C# 队列
    linux shell脚本程序路径作为变量
    C++中头文件(.h)和源文件(.cpp)都应该写些什么
  • 原文地址:https://www.cnblogs.com/xujingyang/p/7070096.html
Copyright © 2020-2023  润新知