• yum安装ftp服务器


    1、安装vsftp,本文采用yum安装:

    #yum install vsftpd

    2、安装后运行:

    # service vsftpd restart

    Shutting downvsftpd:                                     [  OK  ]

    Starting vsftpd forvsftpd:                               [  OK  ]

    3、新增加系统用户ftptest:

    #useradd -d /var/www -s /sbin/nologin gd_user1 //增加新用户ftptest不让在本机登陆

    #chown -R gd_user1/var/www  //更改新增目录的权限,只允许ftptest访问此目录;

    #chmod 777 -R /var/www

    # passwd gd_user1                        //为用户设置密码;

    Changing password for user gd_user1.

    New UNIX password:

    BAD PASSWORD: it does not contain enough DIFFERENTcharacters

    Retype new UNIX password:

    passwd: all authentication tokens updated successfully.

    5、修改vsftpd.conf 禁止匿名帐号登陆及允许自建帐号登陆:

    #vi /etc/vsftpd/vsftpd.conf

    anonymous_enable=NO

    local_enable=YES

    write_enable=YES

    local_umask=022

    dirmessage_enable=YES

    xferlog_enable=YES

    connect_from_port_20=YES

    xferlog_std_format=YES

    chroot_list_enable=YES

    chroot_list_file=/etc/vsftpd/chroot_list

    listen=YES

    pam_service_name=vsftpd

    userlist_enable=YES

    tcp_wrappers=YES

    4、修改/etc/vsftpd/chroot_list 添加gd_user1帐号允许该帐号登陆FTP服务器

    vi /etc/vsftpd/chroot_list

    输入gd_user1

    5、在linux Shell 命令模式下

    #setsebool ftpd_disable_trans 1                      // 关闭掉Selinux 对ftp服务的保护;

    #vi /etc/selinux/config

    SELINUX=disabled                                           //将此处设置为Disable

    # SELINUXTYPE= type of policy in use. Possible valuesare:

    #       targeted – Only targeted network daemons are protected.

    #       strict – Full SELinux protection.

    SELINUXTYPE=targeted

    重启服务

    # service vsftpd restart

    Shutting downvsftpd:                                     [  OK  ]

    Starting vsftpd forvsftpd:                               [  OK  ]

    记得关闭火墙

  • 相关阅读:
    jquery验证手机号码和固定电话号码
    window下安装mongodb及php mongo扩展
    Html form 表单提交前验证
    验证电话号码中间四位加※
    php方法 隐藏手机号中间四位
    win7 64位安装redis 及Redis Desktop Manager使用
    Redis系列-远程连接redis并给redis加锁
    使用密码记录工具keepass来保存密码
    【消息队列MQ】各类MQ比较
    Syslog-ng
  • 原文地址:https://www.cnblogs.com/luhouxiang/p/4773416.html
Copyright © 2020-2023  润新知