美文网首页
centos安装ftp服务器

centos安装ftp服务器

作者: 放风筝的小小马 | 来源:发表于2017-07-17 22:09 被阅读22次
    1. 安裝 vsftpd:
    [root@localhost ~]# yum -y install vsftpd
    [root@localhost ~]# touch /etc/vsftpd/chroot_list
    [root@localhost ~]# chkconfig vsftpd on
    
    1. 打开/etc/vsftpd/vsftpd.conf,做如下配置:
    chroot_local_user=YES  
    chroot_list_enable=YES  
    chroot_list_file=/etc/vsftpd/chroot_list
    

    注意:如果/etc/vsftpd/chroot_list文件不存在,则需要手动建立,在/etc/vsftpd/chroot_list文件中写入加入登陆用户的名字,我的服务器上有一个root用户和一个hexon用户,因此我填入root和hexon在该文件内,每个用户占用一行

    1. 移除ftpusers 裡面的帳號
      vim /etc/vsftpd/ftpusers
      找到root 前面加上#號註解
    [root@localhost ~]# vim /etc/vsftpd/ftpusers
    # Users that are not allowed to login via ftpbin
    #root
    daemon
    adm
    lp
    sync
    shutdown
    halt
    mail
    news
    uucp
    operator
    games
    nobody
    [root@localhost ~]#
    
    1. 移除user_list裡面的帳號
    vim /etc/vsftpd/user_list
    一樣找到root 前面加上#號註解
    [root@localhost ~]# vim /etc/vsftpd/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.bin
    #root
    daemon
    adm
    lp
    sync
    shutdown
    halt
    mail
    news
    uucp
    operator
    games
    nobody
    [root@localhost ~]#
    
    1. 重新啟動VSFTPd
    [root@localhost ~]# /etc/init.d/vsftpd restart
    Shutting down vsftpd: [ OK ]
    Starting vsftpd for vsftpd: [ OK ]
    
    1. 然后使用ftp工具登录服务器

    相关文章

      网友评论

          本文标题:centos安装ftp服务器

          本文链接:https://www.haomeiwen.com/subject/pwgqkxtx.html