感觉非常坑,依照网上说的没一个都測试了,可一直都报错。

不断的又一次安装不下10次,最后一次最终測试出了正确的方法。

#官网配置说明##

https://security.appspot.com/vsftpd/vsftpd_conf.html

##需求##

1)登录FTP 仅仅能看到当前用户的,不能跨越到主文件夹

2)禁止匿名用户登录FTP

3)改动FTP 监听port号!

##问题##

yum install vsftpd

结果一大堆问题。

1)无法启动 systemctl stop vsftpd --> 成功过,第二行 systemctl start vsftpd ==> 一直报错一直报错

  1. [root@niche vsftpd]# whereis vsftpd
  2. vsftpd: /usr/sbin/vsftpd /etc/vsftpd /usr/share/man/man8/vsftpd.8.gz
  3. [root@niche vsftpd]# systemctl status vsftpd
  4. vsftpd.service - Vsftpd ftp daemon
  5. Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled)
  6. Active: failed (Result: exit-code) since Wed 2014-12-17 15:16:58 UTC; 18min a go
  7. Dec 17 15:16:58 niche systemd[1]: vsftpd.service: control process exited, c...=2
  8. Dec 17 15:16:58 niche systemd[1]: Failed to start Vsftpd ftp daemon.
  9. Dec 17 15:16:58 niche systemd[1]: Unit vsftpd.service entered failed state.
  10. Dec 17 15:17:25 niche systemd[1]: Stopped Vsftpd ftp daemon.
  11. Dec 17 15:23:12 niche systemd[1]: Stopped Vsftpd ftp daemon.
  12. Dec 17 15:26:11 niche systemd[1]: Stopped Vsftpd ftp daemon.
  13. Dec 17 15:33:55 niche systemd[1]: Stopped Vsftpd ftp daemon.
  14. Dec 17 15:34:11 niche systemd[1]: Stopped Vsftpd ftp daemon.
  15. Hint: Some lines were ellipsized, use -l to show in full.
  16. [root@niche vsftpd]# systemctl stop vsftpd
  17. [root@niche vsftpd]# systemctl start vsftpd
  18. Job for vsftpd.service failed. See 'systemctl status vsftpd.service' and 'journalctl -xn' for details.
  19. [root@niche vsftpd]#

最后的解决的方法,手动杀死 进程。

ps auxf | grep vsftpd。

然后在重新启动 systemctl start vsftpd,又能够使用systemctl来控制vsftpd了,真的是有点出鬼?

2)禁用匿名用户,本来一開始就改动了vsftpd.conf。可是怎么都无法重新启动无法生效。如今手动杀死进程才干够。

3)锁定在根文件夹,禁止local用户跳出根文件夹。測试了非常多次最后这一行才干够:

chroot_local_user=NO

chroot_list_enable=YES

# (default follows)

chroot_list_file=/etc/vsftpd/chroot_list

4)改动监听port号:配置文件结尾增加新的port号,listen_port=2001,然后重新启动!(by default.fu@foxmail.com)

5)同意chroot !

只对有读写权限的进行!

pam_service_name=vsftpd

userlist_enable=YES

tcp_wrappers=YES

listen_port=2001

pasv_min_port=2100

pasv_max_port=2199

allow_writeable_chroot=YES

1、设置被动模式打开的配置文件

  1. #vim /etc/vsftpd/vsftpd.conf

加入或改动下面内容

  1. connect_from_port_10021=YES     //这里的10021port,你能够改动为你喜欢的 
  2. pasv_min_port=8888           //设置被动模式的port范围。最小port号~最大port号
  3. pasv_max_port=8899          //我们设置的范围能够不用那么大,但数值最好大些(至少也大于1024)

  2、然后更改防火策略

  1. #vim /etc/sysconfig/iptables

加入下面防火规则

-A INPUT -m state --state NEW -m tcp -p tcp --dport 10021 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8888:8899 -j ACCEPT

======================================================

2015-1-12 23:37:27补充

  1. #by default.fu@foxmail.com
  2. [root@unbox vsftpd]# diff vsftpd.conf vsftpd.conf.bak
  3. 12c12
  4. < anonymous_enable=NO
  5. ---
  6. > anonymous_enable=YES
  7. 29c29
  8. < anon_upload_enable=NO
  9. ---
  10. > #anon_upload_enable=YES
  11. 100,101c100,101
  12. < chroot_local_user=NO
  13. < chroot_list_enable=YES
  14. ---
  15. > #chroot_local_user=YES
  16. > #chroot_list_enable=YES
  17. 103c103
  18. < chroot_list_file=/etc/vsftpd/chroot_list
  19. ---
  20. > #chroot_list_file=/etc/vsftpd/chroot_list
  21. 114c114
  22. < listen=YES
  23. ---
  24. > listen=NO
  25. 123c123
  26. < listen_ipv6=NO
  27. ---
  28. > listen_ipv6=YES
  29. 128,131d127
  30. < listen_port=2100
  31. < pasv_min_port=8190
  32. < pasv_max_port=8192
  33. <
  34. [root@unbox vsftpd]#

centos7 安装vsftpd的步骤的更多相关文章

  1. Centos7安装vsftpd (FTP服务器)

    Centos7安装vsftpd (FTP服务器) 原文链接:https://www.jianshu.com/p/9abad055fff6 TyiMan 关注 2016.02.06 21:19* 字数 ...

  2. Centos7安装OpenDCIM-19.01步骤

    Centos7安装OpenDCIM-19.01步骤 openDCIM是一款免费的开源解决方案,用于管理数据中心基础设施.它已经被几家企业组织所使用,由于开发人员的不懈努力,正在迅速完善. openDC ...

  3. Centos7安装Zabbix4.0步骤

    点击返回:自学Zabbix之路 点击返回:自学Zabbix4.0之路 点击返回:自学zabbix集锦 Centos7安装Zabbix4.0步骤 官方搭建zabbix4.0的环境要求: 1. 环境搭建L ...

  4. CentOS7 安装 vsftpd 服务

    CentOS7 安装 vsftpd 服务 0.FTP简介 FTP服务是一个跨平台的文件共享解决方案 0.1.FTP两种模式的区分:服务端的主被动模式 1)ftp一般分为两种模式,PORTFTP和PAS ...

  5. Centos7安装vsftpd

    1.安装vsftpd yum install vsftpd 2.添加一个ftp用户,一个不能登录系统用户,只用来登录ftp服务,这里如果没设置用户目录.默认是在home下. useradd ftpac ...

  6. 【安装vsftpd】安装vsftpd工具步骤

    1 安装vsftpd组件 [root@bogon ~]# yum -y install vsftpd 安装完后,有/etc/vsftpd/vsftpd.conf 文件,是vsftp的配置文件. 2 添 ...

  7. centos7安装Docker详细步骤(无坑版教程)

    一.安装前必读 在安装 Docker 之前,先说一下配置,我这里是Centos7 Linux 内核:官方建议 3.10 以上,3.8以上貌似也可. 注意:本文的命令使用的是 root 用户登录执行,不 ...

  8. CentOS7安装PHP简易步骤

    安装前准备 yum update yum install -y vim yum install -y wget yum install -y bzip2 yum install -y gcc gcc+ ...

  9. CentOS7 安装 Docker CE步骤

    准备工作 系统要求 Docker CE 支持 64 位版本 CentOS 7,并且要求内核版本不低于 3.10. CentOS 7 满足最低内核的要求,但由于内核版本比较低,部分功能(如 overla ...

随机推荐

  1. 微信小程序图片选择,预览和删除

    这里均用的是小程序原生api 废话不多说直接上栗子: <view class="addImv"> <!--这个是已经选好的图片--> <view wx ...

  2. java_基础知识_字符串练习题_计算两个字符串的最长公共字串长度

    package tek; Java算法——求出两个字符串的最长公共字符串 /** * @Title: 问题:有两个字符串str1和str2,求出两个字符串中最长公共字符串. * @author 匹夫( ...

  3. python框架之Flask基础篇(四)-------- 其他操作

    1.蓝图 要用蓝图管理项目,需要导入的包是:from flask import Buleprint 具体大致分为三步: 1.先在子模块中导入蓝图包,然后再创建蓝图对象. 2.然后将子模块中的视图函数存 ...

  4. SAS学习笔记之《SAS编程与数据挖掘商业案例》(1)系统简介和编程基础

    SAS学习笔记之<SAS编程与数据挖掘商业案例>(1)系统简介和编程基础 1. SAS系统简介 1.1 SAS是先编译后执行的语言,data步标志着编译的开始. 数据指针:当前内存缓存区, ...

  5. JS高级——apply与call

    上下文调用模式 可以修改this的值,也就是可以修改函数的调用方式,apply.call可以修改函数调用上下文,也就是this的值 <script> var name = "莱昂 ...

  6. 4xx错误的本质:服务器已经接收到请求

    4xx错误的本质:服务器已经接收到请求, 路径错误! { URL: http://10.100.138.32:8046/3-0/app/account/maxin } { status code: 4 ...

  7. 【centOS7】Jenkins安装--漫漫踩坑路

    安装步骤: https://www.cnblogs.com/h--d/p/5673085.html 安装后遇到的问题及解决办法: jenkins的admin用户的初始密码路径 https://blog ...

  8. Node.js 命令行程序开发教程 ---------http://www.ruanyifeng.com/blog/2015/05/command-line-with-node.html

    五.yargs 模块 shelljs 只解决了如何调用 shell 命令,而 yargs 模块能够解决如何处理命令行参数.它也需要安装. $ npm install --save yargs yarg ...

  9. 为Unity的新版ugui的Prefab生成预览图

    using UnityEngine;using System.Collections;using UnityEditor;using System.IO; [CustomPreview(typeof( ...

  10. .NET 大数据量并发解决方案

    https://www.cnblogs.com/wxlevel/p/7484738.html