• Centos7下安装FTP文件服务器


    1. 安装VSFTP
    [root@localhost ~]# yum -y install vsftpd

    2修改配置 vim /etc/vsftpd/vsftpd.conf
    # Example config file /etc/vsftpd/vsftpd.conf
    anonymous_enable=YES
    local_enable=YES
    write_enable=YES
    local_umask=022
    dirmessage_enable=YES
    xferlog_enable=YES
    connect_from_port_20=YES

    listen=NO


    listen_ipv6=YES
    anon_upload_enable=YES
    anon_mkdir_write_enable=YES
    local_root=/mnt/disk/nginx/html/temp
    anon_root=/mnt/disk/nginx/html/temp
    allow_writeable_chroot=YES
    userlist_file=/etc/vsftpd/user_list
    userlist_enable=NO
    chroot_local_user=YES
    pam_service_name=vsftpd
    tcp_wrappers=YES

    3.以下文件中注释掉root 用户
    user_list ftpuer
    # 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
    touchlms
    touch

    4.授权目录
    chmod -R 777 /mnt/disk/nginx/html/temp

    此时查看日志文件tail -f /var/log/secure

    CentOS vsftp 553 Could not create file 错误解决(

    输入 setsebool allow_ftpd_full_access on )
    症状:用户可以从远程服务器登录ftp,可以查看ftp各种路径文件,但是不能上传,上传提示553 Could not create file.
    查看了各种文件夹权限,都设置没问题,最后发现是SELinux问题,

    查看SELinux设置:

    [root@beaconvm02 vsftpd]# getsebool -a | grep ftp
    allow_ftpd_anon_write --> off
    allow_ftpd_full_access --> off
    allow_ftpd_use_cifs --> off
    allow_ftpd_use_nfs --> off
    ftp_home_dir --> off
    ftpd_connect_db --> off
    ftpd_use_fusefs --> off
    ftpd_use_passive_mode --> off
    httpd_enable_ftp_server --> off
    tftp_anon_write --> off
    tftp_use_cifs --> off
    tftp_use_nfs --> off

    问题在于,要把allow_ftpd_full_access设置为on,修改设置
    [root@beaconvm02 vsftpd]# setsebool allow_ftpd_full_access on(重新开机后失效) 或 setsebool -P allow_ftpd_full_access on(长久生效)

    再查看一遍
    [root@beaconvm02 vsftpd]# getsebool -a | grep ftp
    allow_ftpd_anon_write --> off
    allow_ftpd_full_access --> on
    allow_ftpd_use_cifs --> off
    allow_ftpd_use_nfs --> off
    ftp_home_dir --> off
    ftpd_connect_db --> off
    ftpd_use_fusefs --> off
    ftpd_use_passive_mode --> off
    httpd_enable_ftp_server --> off
    tftp_anon_write --> off
    tftp_use_cifs --> off
    tftp_use_nfs --> off
    [root@beaconvm02 vsftpd]#
    再重新上传文件,成功。

    5.开启,重启,停止服务
    systemctl start vsftpd.service
    systemctl restart vsftpd.service
    systemctl stop vsftpd.service
    systemctl status vsftpd.service

    systemctl enable vsftpd.service  开机自启动

    7.默认开启vsftp服务
    chkconfig vsftpd on

    8.centos 卸载vsftpd方法
    如果服务器上安装了vsftpd,配置出错需要卸载vsftpd
    [root@localhost ~]# rpm -aq vsftpd
    vsftpd-2.0.5-16.el5_5.1 #此处是查找vsftpd的返回结果
    [root@localhost ~]# rpm -e vsftpd-2.0.5-16.el5_5.1

  • 相关阅读:
    关于MySQL慢日志,你想知道的都在这
    h5 唤起app或跳转appStore
    ios 报错 Invalid row height provided by table delegate. Value must be at least 0.0, or UITableViewAutomaticDi......
    url的长度问题
    CUICatalog: Invalid asset name supplied:
    -[UITableView copyWithZone:]: unrecognized selector sent to instance 0x7XXXXXX00
    iOS项目运行出现:[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object
    UICachedDeviceRGBColor CGImage]: unrecognized selector sent to instance 0xxxxxxxxxxx'
    iOS Xcode 10: Multiple commands produce
    2019 开篇
  • 原文地址:https://www.cnblogs.com/xmyfsj/p/10612748.html
Copyright © 2020-2023  润新知