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

不断的又一次安装不下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 ==> 一直报错一直报错

[root@niche vsftpd]# whereis vsftpd
vsftpd: /usr/sbin/vsftpd /etc/vsftpd /usr/share/man/man8/vsftpd.8.gz
[root@niche vsftpd]# systemctl status vsftpd
vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled)
Active: failed (Result: exit-code) since Wed 2014-12-17 15:16:58 UTC; 18min a go Dec 17 15:16:58 niche systemd[1]: vsftpd.service: control process exited, c...=2
Dec 17 15:16:58 niche systemd[1]: Failed to start Vsftpd ftp daemon.
Dec 17 15:16:58 niche systemd[1]: Unit vsftpd.service entered failed state.
Dec 17 15:17:25 niche systemd[1]: Stopped Vsftpd ftp daemon.
Dec 17 15:23:12 niche systemd[1]: Stopped Vsftpd ftp daemon.
Dec 17 15:26:11 niche systemd[1]: Stopped Vsftpd ftp daemon.
Dec 17 15:33:55 niche systemd[1]: Stopped Vsftpd ftp daemon.
Dec 17 15:34:11 niche systemd[1]: Stopped Vsftpd ftp daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@niche vsftpd]# systemctl stop vsftpd
[root@niche vsftpd]# systemctl start vsftpd
Job for vsftpd.service failed. See 'systemctl status vsftpd.service' and 'journalctl -xn' for details.
[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、设置被动模式打开的配置文件

#vim /etc/vsftpd/vsftpd.conf

加入或改动下面内容

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

  2、然后更改防火策略

#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补充

#by default.fu@foxmail.com
[root@unbox vsftpd]# diff vsftpd.conf vsftpd.conf.bak
12c12
< anonymous_enable=NO
---
> anonymous_enable=YES
29c29
< anon_upload_enable=NO
---
> #anon_upload_enable=YES
100,101c100,101
< chroot_local_user=NO
< chroot_list_enable=YES
---
> #chroot_local_user=YES
> #chroot_list_enable=YES
103c103
< chroot_list_file=/etc/vsftpd/chroot_list
---
> #chroot_list_file=/etc/vsftpd/chroot_list
114c114
< listen=YES
---
> listen=NO
123c123
< listen_ipv6=NO
---
> listen_ipv6=YES
128,131d127
< listen_port=2100
< pasv_min_port=8190
< pasv_max_port=8192
<
[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. hastable 用法

    一,哈希表(Hashtable)简述 在.NET Framework中,Hashtable是System.Collections命名空间提供的一个容器,用于处理和表现类似keyvalue的键值对,其中 ...

  2. RocketMQ(1)--helloworld

    双Master方式: 服务器环境 序号 IP 角色 模式 1 192.168.32.135 nameServer1,brokerServer1  Master1 2 192.168.32.136 na ...

  3. TypeScript `infer` 关键字

    考察如下类型: type PromiseType<T> = (args: any[]) => Promise<T>; 那么对于符合上面类型的一个方法,如何得知其 Prom ...

  4. 个人作业 - Alpha 项目测试

    写在前面 课程链接:https://edu.cnblogs.com/campus/xnsy/SoftwareEngineeringClass2 作业要求:https://edu.cnblogs.com ...

  5. HTML--文本域,支持多行文本输入

    当用户需要在表单中输入大段文字时,需要用到文本输入域. 语法: <textarea rows="行数" cols="列数">文本</texta ...

  6. Cookie localStorage sessionStorage

    三者的异同 特性 Cookie localStorage sessionStorage 数据的生命期 可设置失效时间,默认是关闭浏览器后失效 除非被清除,否则永久保存 仅在当前会话下(tab标签页)有 ...

  7. RecyclerView中item无法充满的问题

    首先致谢:https://blog.csdn.net/yuanlvmao/article/details/51694211 咱们不是代码的生产者,只是代码的搬运工. 今天写了一个RecyclerVie ...

  8. MySQL实现当前数据表的所有时间都增加或减少指定的时间间隔

    DATE_ADD() 函数向日期添加指定的时间间隔. 当前表所有数据都往后增加一天时间: UPDATE ACT_BlockNum SET CreateTime = DATE_ADD(CreateTim ...

  9. dotnetnuke 添加用户属性 Profile

    if (DotNetNuke.Entities.Profile.ProfileController.GetPropertyDefinitionByName(this.PortalId, "Q ...

  10. #1003 Max Sum

    http://acm.hdu.edu.cn/showproblem.php?pid=1003 给你一串数列,让你求出其中 一段连续的子数列 并且 该子数列所有数字之和最大,输出该子数列的和.起点与终点 ...