VsFTP离线安装

2023-11-19

vsftp离线安装(安装包链接:https://pan.baidu.com/s/1qNmXWh3Ks5bzc_rn1ytchQ 

提取码:397i
)
1.查看服务器是否安装FTP,如图则表示没有安装
Shell>rpm -qa|grep vsftpd
在这里插入图片描述
2.上传ftp文件到服务器,先切换到ftp压缩包的路径下,在进行安装:
Shell>cd /usr/local/vsftpd
Shell>rpm -ivh vsftpd-3.0.2-25.el7.x86_64.rpm
在这里插入图片描述
3.将ftp服务器设置为自动启动,注意下方式不同,图提示是正常的,不代表出错了:
Shell>chkconfig vsftpd on
在这里插入图片描述
4.重启ftp服务器,查看ftp服务器的状态,如图表示成功:
Shell>systemctl restart vsftpd.service
Shell>systemctl status vsftpd.service
在这里插入图片描述
5.5编辑编辑vsftpd配置文件如下(下面这一段就是vsftp.conf配置文件的全部内容,可以直接复制用):
Shell>vi /etc/vsftpd/vsftpd.conf

Example config file /etc/vsftpd/vsftpd.conf

The default compiled in settings are fairly paranoid. This sample file

loosens things up a bit, to make the ftp daemon more usable.

Please see vsftpd.conf.5 for all compiled in defaults.

READ THIS: This example file is NOT an exhaustive list of vsftpd options.

Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd’s

capabilities.

Allow anonymous FTP? (Beware - allowed by default if you comment this out).

anonymous_enable=NO—

Uncomment this to allow local users to log in.

When SELinux is enforcing check for SE bool ftp_home_dir

local_enable=YES

Uncomment this to enable any form of FTP write command.

write_enable=YES

Default umask for local users is 077. You may wish to change this to 022,

if your users expect that (022 is used by most other ftpd’s)

local_umask=022

Uncomment this to allow the anonymous FTP user to upload files. This only

has an effect if the above global write enable is activated. Also, you will

obviously need to create a directory writable by the FTP user.

When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access

#anon_upload_enable=YES

Uncomment this if you want the anonymous FTP user to be able to create

new directories.

anon_mkdir_write_enable=YES

Activate directory messages - messages given to remote users when they

go into a certain directory.

dirmessage_enable=YES

Activate logging of uploads/downloads.

xferlog_enable=YES

Make sure PORT transfer connections originate from port 20 (ftp-data).

connect_from_port_20=YES

If you want, you can arrange for uploaded anonymous files to be owned by

a different user. Note! Using “root” for uploaded files is not

recommended!

chown_uploads=YES
#chown_username=whoever

You may override where the log file goes if you like. The default is shown

below.

#xferlog_file=/var/log/xferlog

If you want, you can have your log file in standard ftpd xferlog format.

Note that the default log file location is /var/log/xferlog in this case.

xferlog_std_format=YES

You may change the default value for timing out an idle session.

idle_session_timeout=600

You may change the default value for timing out a data connection.

data_connection_timeout=120

It is recommended that you define on your system a unique user which the

ftp server can use as a totally isolated and unprivileged user.

#nopriv_user=ftpsecure

Enable this and the server will recognise asynchronous ABOR requests. Not

recommended for security (the code is non-trivial). Not enabling it,

however, may confuse older FTP clients.

async_abor_enable=YES

By default the server will pretend to allow ASCII mode but in fact ignore

the request. Turn on the below options to have the server actually do ASCII

mangling on files when in ASCII mode. The vsftpd.conf(5) man page explains

the behaviour when these options are disabled.

Beware that on some FTP servers, ASCII support allows a denial of service

attack (DoS) via the command “SIZE /big/file” in ASCII mode. vsftpd

predicted this attack and has always been safe, reporting the size of the

raw file.

ASCII mangling is a horrible feature of the protocol.

ascii_upload_enable=YES
ascii_download_enable=YES

You may fully customise the login banner string:

ftpd_banner=Welcome to zc FTP service.

You may specify a file of disallowed anonymous e-mail addresses. Apparently

useful for combatting certain DoS attacks.

#deny_email_enable=YES

(default follows)

#banned_email_file=/etc/vsftpd/banned_emails

You may specify an explicit list of local users to chroot() to their home

directory. If chroot_local_user is YES, then this list becomes a list of

users to NOT chroot().

(Warning! chroot’ing can be very dangerous. If using chroot, make sure that

the user does not have write access to the top level directory within the

chroot)

chroot_local_user=YES
#chroot_list_enable=YES

(default follows)

#chroot_list_file=/etc/vsftpd/chroot_list

You may activate the “-R” option to the builtin ls. This is disabled by

default to avoid remote users being able to cause excessive I/O on large

sites. However, some broken FTP clients such as “ncftp” and “mirror” assume

the presence of the “-R” option, so there is a strong case for enabling it.

ls_recurse_enable=YES

When “listen” directive is enabled, vsftpd runs in standalone mode and

listens on IPv4 sockets. This directive cannot be used in conjunction

with the listen_ipv6 directive.

listen=NO

This directive enables listening on IPv6 sockets. By default, listening

on the IPv6 “any” address (:? will accept connections from both IPv6

and IPv4 clients. It is not necessary to listen on both IPv4 and IPv6

sockets. If you want that (perhaps because you want to listen on specific

addresses) then you must run two copies of vsftpd with two configuration

files.

Make sure, that one of the listen options is commented !!

listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

#以下为新增

userlist_enable=YES
tcp_wrappers=YES
use_localtime=YES
listen_port=21
idle_session_timeout=300
guest_enable=YES
guest_username=zcftp
user_config_dir=/etc/vsftpd/vconf
data_connection_timeout=1
virtual_use_local_privs=YES
pasv_min_port=30000
pasv_max_port=31000
accept_timeout=5
connect_timeout=1
allow_writeable_chroot=YES

pasv_enable=YES
pasv_min_port=30000
pasv_max_port=31000

6.建立用户文件,两行分别是账号和密码如下图
Shell>vi /etc/vsftpd/virtusers
在这里插入图片描述
7.生成用户数据文件:
Shell>db_load -T -t hash -f /etc/vsftpd/virtusers /etc/vsftpd/virtusers.db
在这里插入图片描述
8.设定PAM验证文件,并指定对虚拟用户数据库文件进行读取
Shell>chmod 777 /etc/vsftpd/virtusers.db
在这里插入图片描述
9.修改 /etc/pam.d/vsftpd 文件,修改前先做个备份:
Shell>cp /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bak
Shell>vi /etc/pam.d/vsftpd

10.先将配置文件中原有的 auth 及 account 的所有配置行均注释掉
Shell>auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers
Shell>account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/virtusers
在这里插入图片描述
11.新建系统用户zcftp,用户目录为/data/ftp,用户登录终端设为/bin/false(即:使之不能登录系统)
Shell>useradd zcftp -d /data/ftp -s /bin/false
Shell>chown -R zcftp:zcftp /data/ftp
(这里会提示没有文件夹,可以先不管后面建,也可以现在建data/ftp)

12.建立虚拟用户个人配置文件:
Shell>mkdir /etc/vsftpd/vconf

13.这里建立虚拟用户zcftp配置文件:
Shell>touch zcftp

14.编辑zcftp用户配置文件,内容如下,其他用户类似:
Shell>vi zcftp
#----------编辑zcftp内容如下------------#
local_root=/data/ftp/
write_enable=YES
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
在这里插入图片描述
15.建立zcftp用户根目录:
Shell>mkdir -p /data/ftp/

16.防火墙设置,添加如下内容,开启防火墙端口:
Shell>vi /etc/sysconfig/iptables ##编辑文件
Shell>-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
Shell>-A INPUT -m state --state NEW -m tcp -p tcp --dport 30000:31000 -j ACCEPT
在这里插入图片描述
17.查询指定端口是否已开 提示 yes,表示开启;no表示未开启。
Shell>firewall-cmd --query-port=21/tcp
Shell>firewall-cmd --query-port=20/tcp

18.如果端口没开,则打开对应的端口:
Shell>firewall-cmd --zone=public --add-port=21/tcp --permanent
Shell>firewall-cmd --zone=public --add-port=20/tcp --permanent
shell>firewall-cmd --list-all ##列出已经打开的端口

19.编辑以下文件
Shell>vi /etc/selinux/config
Shell>SELINUX=disabled
在这里插入图片描述
20.在server端的防火墙中开放ftp服务
Shell>firewall-cmd --add-service=ftp --permanent ##解决工具连接显示获取不到根目录
Shell>firewall-cmd --reload ##重载防火墙,然后就好了晒。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

VsFTP离线安装 的相关文章

  • docker && Tugraph

    拉取tugraph镜像 docker pull tugraph tugraph db centos7 启动docker docker run d p 7070 7070 p 9090 9090 name tugraph demo tugra
  • Oracle Sequence Cache 参数说明

    之前整理的一篇文章 ORACLE SEQUENCE 介绍 http blog csdn net tianlesoftware archive 2009 10 30 4745039 aspx 之前整理的一篇文章 那是还是写blog初期的作品
  • nacos 的 cp 和 ap

    如果只有一个 nacos 节点 可以直接以单机模式启动 naming 功能是完全正常的 也可以以集群模式启动 配置文件中只配一个节点即可 但是 因为此时 nacos 的 raft 实现中 一个节点是选不了主的 所以 cp 模式的 raft
  • matlab绘制贝叶斯曲线,Matlab建立SVM,KNN和朴素贝叶斯模型分类绘制ROC曲线

    原文链接 http tecdat cn p 15508 绘制ROC曲线通过Logistic回归进行分类 加载样本数据 load fisheriris通过使用与versicolor和virginica物种相对应的度量来定义二元分类问题 pre
  • java 布尔类型_Java布尔类型

    Java布尔类型 在Java语言中布尔类型的值只包括true和false 没有其他值 不包括1和0 布尔类型的数据在开发中主要使用在逻辑判断方面 例如 如果外面在下雨 我出门带一把雨伞 如果明天休息 咱们就一起出去玩耍吧 请看一段程序 以下

随机推荐

  • 文件包含漏洞及绕过方法(以php为例)

    一 文件包含漏洞的由来 简单的来说 为了减少 重复造轮子 引入了文件包含函数 可以直接使用文件中的文件和代码 当通过动态获文件时 或者需要引用网络上其他文件时 用户通过对变量值的修改访问规定的文件 但是未对变量值进行校验 导致有了可乘之机
  • 前端vue面试

    用户登陆产品了解生命周期vuex数据平台干嘛vue X怎么持久localstore和cokIE区别路由传惨路由传惨两种方式区别 1 谈一谈你对keep alive的了解P1 2 三 v if v show的区别 3 四 v if和v for
  • 服务器柜机位置摆放电子图,客厅柜机摆放—客厅柜机空调摆放方法介绍

    客厅是一家人在一起活动最多的房间 所以家具及家电等产品的摆放就要有一定的讲究了 其中柜机空调的摆放方法尤其为消费者所关注 下面 小编就详细的向您介绍一下客厅柜机摆放的方法 有兴趣的朋友一起来了解一下吧 客厅柜机摆放 客厅柜机摆放 正确摆放位
  • VectorCAST软件下载安装使用试用培训购买

    商业软件如需下载安装使用试用 可以通过下面添加 提供编译器定制 技术支持 培训 wanglequshuijiao 有需要可以加详细聊 vx 静态测试软件 QAC Klocwork Coverity等 单元测试软件 集成测试软件 Vector
  • 超详细!Jmeter性能测试(二)

    Jmeter 性能测试 二 关联 正则表达式提取器和JSON Extractor提取器 接入上篇博文继续 上篇地址 https blog csdn net weixin 44954642 article details 103054387
  • MySQL几种创建索引的方式

    一 创建表时创建索引 key 索引名 column 二 表创建好后创建索引 1 通过Alter创建索引 PRIMARY KEY 主键索引 mysql gt ALTER TABLE table name ADD PRIMARY KEY col
  • 设计模式七大原则

    1 设计模式的目的 编写软件过程中 程序员面临着来自耦合性 内聚性以及可维护性 可扩展性 重用性 灵活性 等多方面的挑战 设计模式是为了让程序 软件 具有更好 1 代码重用性 即 相同功能的代码 不用多次编写 2 可读性 即 编程规范性 便
  • npm插件安装插件失败问题解决办法

    目录 问题索引列表 错误记录 在线地址pdf转word https www camscanner com pdftopic 问题索引列表 1 配置安装自定义位置nodejs 1 1 使用npm安装模块的位置有默认安装位置和指定安装位置 在W
  • Java自学第15天 面向对象(全)

    面向过程 面向对象 面向过程思想 步骤清晰简单 第一步做什么 第二步做什么 面对过程适合处理一些较为简单的问题 面向对象思想 物以类聚 分类的思维模式 思考问题首先会解决问题需要哪些分类 然后对这些分类进行单独思考 最后 才对某个分类下的细
  • javaSE进阶1之static用法

    JavaSE进阶 静态关键字 static static关键字的作用 成员变量分类 静态成员变量 实例成员变量 static修饰成员变量内存原理 static 修饰成员方法的基本用法 成员方法的分类 static修饰成员方法内存原理 sta
  • [原]Pro*C介绍-内嵌SQL

    Translate by Z Jingwei Document address http www db stanford edu ullman fcdb oracle or proc html Pro C介绍内嵌SQL 概要 Pro C语法
  • selenium自动化测试实战

    一 Selenium介绍 Selenium 是什么 一句话 自动化测试工具 它支持各种浏览器 包括 Chrome Safari Firefox 等主流界面式浏览器 如果你在这些浏览器里面安装一个 Selenium 的插件 那么便可以方便地实
  • Java开发中关于实体类的一些注解

    JSONField注解 FastJson中的注解 JSONField 一般作用在get set方法 常用的有以下三个场景 修改字段映射 private String name 实体类序列化为json字符串的时候 该类的name字段 序列化为
  • Integer 和 int

    一 区别 1 Integer是int的包装类 int则是java的一种基本的数据类型 2 Integer变量必须实例化之后才能使用 而int变量不需要实例化 3 Integer实际是对象的引用 当new一个Integer时 实际上生成一个指
  • Hadoop的安装与调试(2)

    本节内容包括 虚拟机的克隆 虚拟机配置 虚拟机IP配置 windows网络配置 虚拟机重命名 固定IP映射 设置mac地址 配置静态IP 测试 进入虚拟机 先登录用户 接下来用以下命令创建三个文件夹 四 虚拟机的克隆 1 先关闭虚拟机 2
  • 一文搞定attntion机制在CNN中的应用,手把手教你在Yolov5中插入attention. Attention结构的创新方法

    免责声明 1 此方法仅提供参考 2 搬了其他博主的操作方法 以贴上路径 3 场景一 什么是Attention 场景二 Attention在cnn上的作用 场景三 常见的Attention机制 场景四 Attention机制的创新思路 场景五
  • HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException:...

    1 HTTP Status 500 Request processing failed nested exception is java lang IllegalArgumentException Control character in
  • U盘在别人电脑上正常显示,插在自己电脑读不出来(只显示CD驱动器)

    问题 同事A用U盘 从同事B电脑上拷贝文件 U盘插在其他同事电脑上都正常使用 插回自己电脑上读不出来 或者只显示CD驱动器 原因 种情况是驱动程序问题导致 可以把U盘插入电脑然后在设备管理里删掉设备重新插入即可 解决步骤 1 插上U盘 2
  • LLM大语言模型-MOSS解读

    原始blog在 notion 中 这里帖一个 notion的链接吧 LLM大语言模型 MOSS解读
  • VsFTP离线安装

    vsftp离线安装 安装包链接 https pan baidu com s 1qNmXWh3Ks5bzc rn1ytchQ 提取码 397i 1 查看服务器是否安装FTP 如图则表示没有安装 Shell gt rpm qa grep vsf