zoukankan      html  css  js  c++  java
  • Centos 7 部署FTP服务简单版

    第三方教程推荐与参考:

    http://blog.csdn.net/somehow1002/article/details/70232791 

    先安装成功了,有信心了。再进一步扩展配置。

    1、安装vsftpd

    $ yum install vsftpd -y

     

    2、配置Vsftpd

    官方文档:http://vsftpd.beasts.org/vsftpd_conf.html

    第三方中文文档:http://blog.sina.com.cn/s/blog_56ae1d580100yhel.html

    $ vim /etc/vsftpd/vsftpd.conf
    # 默认NO,如果YES则可以使用/etc/passwd中的普通用户帐户登录
    local_enable=YES
    
    # 允许写入,修改,删除权限
    write_enable=YES
    
    # 启动日志,该文件默认放置在/var/log/vsftpd.log中,可以配置vsftpd_log_file覆盖此位置
    xferlog_enable=YES
    
    # 【如果想要本地用户登录就必须开启】
    # 本地用户验证要用pam
    配置文件。配置内容默认即可。pam配置文件在/etc/pam.d/vsftpd,
    # userlist是在验证密码之前拒绝用户登录,pam是在密码验证之后拒绝登录。

    pam_service_name
    =vsftpd

    3、关掉防火墙以及SELINUX

    “学红帽的时候,讲师一通吹,说这个SELinux如何厉害,如何安全。我们问这东西怎么用,他说关了算了,和好多服务都冲突。至少我是遇到过和vsftp冲突,用LAMP搭建论坛时也冲突了,懒得去查具体问题,直接关了”
    # 防火墙添加放行ftp服务
    $ firewall-cmd --permanent --zone=public --add-service=ftp

    # 关闭SELINUX
    $ vi /etc/selinux/config

    # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing.
    SELINUX=disabled # disabled - No SELinux policy is loaded. # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls -
    Multi Level Security protection. SELINUXTYPE=targeted setenforce 0

     

    4、添加用户

    设置FTP用户的账号,例如账号为“ftpuser1”,目录为/home/ftpuser1,且设置不允许通过ssh登录。

    $ useradd -d /home/ftpuser1 -s /sbin/nologin ftpuser1  
    $ passwd ftpuser1

     

    5、启动vsfptd服务

    $ systemctl enable vsftpd
    $ systemctl start vsftpd.service
    $ systemctl restart vsftpd.service

  • 相关阅读:
    nginx命令
    MyBatis的动态SQL详解
    使用group_concat 时,设置mysql默认的长度
    mysql 设置可以外部访问
    mysql workbench建表时PK,NN,UQ,BIN,UN,ZF,AI
    SpringMVC之REST
    SpringMVC之@PathVariable 映射 URL 绑定的占位符
    SpringMVC之使用 @RequestMapping 映射请求
    DispatcherServlet源码注解分析
    SpringMVC之HelloWorld
  • 原文地址:https://www.cnblogs.com/CyLee/p/8358321.html
Copyright © 2011-2022 走看看