VSFTP超详细安装教程

目录

简介

一、安装

1、安装准备

2、安装检查

3、创建帐户

4、修改PAM

5、关闭SELinux

二、VSFTP相关配置

三、重启并访问

四、卸载VSFTP

简介

VSFTP(也称为 VSFTPD,代表 "Very Secure FTP Daemon")是一个用于实现 FTP 服务的开源服务器软件。FTP(文件传输协议)是一种允许在网络上进行文件上传和下载的协议。VSFTP 被设计为高度安全、高性能、且可靠的 FTP 服务器解决方案。

VSFTP 具有以下特点:

  • 安全性:它提供了多种安全特性,如支持 TLS/SSL 加密,以确保 FTP 传输的安全性。
  • 高性能:VSFTP 被设计为能够处理大量并发连接而不会降低性能。
  • 可配置性:用户可以根据需求配置其行为,包括控制用户权限、匿名 FTP、虚拟用户等。
  • 兼容性:支持各种 FTP 标准和扩展。

VSFTP 通常用于 Linux 和类 Unix 系统,是流行的 FTP 服务器选择之一,适用于设置 FTP 服务以便在网络上共享文件。

一、安装

1、安装准备

安装前先准备好安装包,有镜像源的可以是下载yum源包,因为我这边是没有镜像源的,所以是有点是rpm离线安装包。

安装包我使用的是vsftpd-3.0.2-25.el7.x86_64版本的rpm包,包我放在下面,需要的可自提:

http://链接:https://pan.baidu.com/s/1uPuZ5IO93CNXe0baYOsZtA?pwd=ksqi 提取码:ksqi

2、安装检查

检查是否安装:

rpm -qa | grep vsftpd

 安装已下载的rpm:

rpm -ivh vsftpd-3.0.2-22.el7.x86_64.rpm

 启动:

systemctl start vsftpd

 设置开机自启动:

chkconfig --level 35 vsftpd on

3、创建帐户

创建用户(没有指定主目录,默认在/home创建用户名的目录作为主目录):

useradd ftpuser

创建用户并指定主目录:

useradd -d /home/ftpuser -m ftpuser

 禁止用户登录访问操作系统:

usermod -s /sbin/nologin ftpuser

 设置密码,需要复杂一点:

passwd ftpuser

4、修改PAM

有些centos7环境PAM不生效(以下选择性配置) :

vi /etc/pam.d/vsftpd 

注释以下内容之后再重启 vsftp:
# auth required pam_listfile.so item=user sense=deny
file=/etc/vsftpd/ftpusers onerr=succeed
# auth required pam_shells.so

5、关闭SELinux

有些系统默认打开selinux,导致FTP只能连接,无法上传(以下选择性配置):
然后重启设备生效。

二、VSFTP相关配置

1、更改 user_list
添加 ftpuser 用户到此文件中,其它删除
vi /etc/vsftpd/user_list 
2、 更改 ftpusers
删除 ftpuser 用户到此文件中,其它保留
vi /etc/vsftpd/ftpusers

3、添加userconfig

mkdir /etc/vsftpd/userconfig

vi /etc/vsftpd/userconfig/ftpuser 

************

# 添加以下内容,路径是独立磁盘的目录
local_root=/opt/ftpuser
************

4、更改vsftpd.conf(仅供参考,注意修改数据目录和用户名)

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 blah 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 = YES
#
# 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 = NO
pam_service_name = vsftpd
userlist_enable = YES
tcp_wrappers = YES
chroot_local_user = YES
userlist_deny = NO
allow_writeable_chroot = YES
user_config_dir = /etc/vsftpd/userconfig
pasv_min_port = 10060
pasv_max_port = 12090
ftp_username = ftpuser
# 路径是独立磁盘的目录
local_root = /opt/ftpuser
# 连接端口(默认 21
# listen_port=21

三、重启并访问

systemctl restart vsftpd
使用 FTP 客户端( FileZilla\winSCP 等)连接,并上传文件。

四、卸载VSFTP

rpm -e vsftpd-3.0.2-22.el7.x86_64

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/598566.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

跨境电商日报:虾皮开设新物流中心;Tk Shop菲律宾调整佣金费率

2024年5月7日跨境电商日报目录: 1.Shopee开设新物流中心; 2.TikTok Shop菲律宾站调整佣金费率; 3.野莓海外仓卖家可以销售9公斤以上商品; 4.亚马逊一季度净销售额同比增长13%; 5.巴西对华二氧化钛启动反倾销调查 …

AI原生实践:测试用例创作探索

测试用例作为质量保障的核心,影响着研发-测试-发布-上线的全过程,如单元测试用例、手工测试用例、接口自动化用例、UI 自动化用例等,但用例撰写的高成本尤其是自动化用例,导致了用例的可持续积累、更新和迭代受到非常大制约。长久…

如何利用工作流自定义一个AI智能体

选择平台 目前已经有不少大模型平台都提供自定义智能体的功能,比如 百度的文心 https://agents.baidu.com/ 阿里的百炼平台 https://bailian.console.aliyun.com/。 今天再来介绍一个平台扣子(https://www.coze.cn/),扣子是…

被忽略的C语言堆栈内存编程细节

没想到,评论区的一个提问,成了我知识的裂缝。🤣 前段时间解决了自己代码中的一个关于栈内存问题,便班门弄斧的写了一篇文章栈内存文章,没想到发出来很快便被大佬发现了其中一个问题🤣,在评论区里…

程序员的神器指南!揭秘软件开发必备工具

在软件开发的广袤海洋中,程序员们像是驾驶着帆船探索未知的航海者。他们面对的不仅仅是代码的挑战,还有项目管理、协作沟通和时间限制的压力。为了应对这些挑战,程序员们需要一系列强大的工具,就像是海中的指南针,帮助…

项目又延期了,怎么办?

Ada问:负责的几个版本上线都延期了,在测试环境出了问题,改过再测上线后,还是出问题。身为产品经理,很困惑,项目不断延期,又被打脸。怎么办? 学姐回答: 经理每天都是忙着…

mac安装linux的centos strem9 虚拟机解压rar文件报错

背景:解压rar文件需要再linux上安装unrar工具 yum install unrar直接安装的后解压报错,如图 解决办法: 下载:wget https://www.rarlab.com/rar/rarlinux-x64-6.0.2.tar.gz 安装: tar -zxvf rarlinux-x64-6.0.2.tar.gz cd rar …

C语言例题35、反向输出字符串(指针方式),例如:输入abcde,输出edcba

#include <stdio.h>void reverse(char *p) {int len 0;while (*p ! \0) { //取得字符串长度p;len;}while (len > 0) { //反向打印到终端printf("%c", *--p);len--;} }int main() {char s[255];printf("请输入一个字符串&#xff1a;");gets(s)…

redis持久化存储

Redis的持久化机制 Redis是一个基于内存的数据库&#xff0c;它的数据是存放在内存中&#xff0c;内存有个问题就是关闭服务或者断电会丢失。Redis的数据也支持写到硬盘中&#xff0c;这个过程就叫做持久化。 Redis提供如下两种持久化方式 RDB&#xff08;Redis DataBase&am…

外网禅道配置

exportfs -avrf 修改代码&#xff0c;避免启动太慢&#xff1a;vi /opt/zbox/bin/zbox.php 启动和停止 /opt/zbox/zbox start /opt/zbox/zbox stop

如何保护数据安全?迅软DSE加密系统给信息撑把保护伞!

信息安全当然需要保护&#xff0c;不然企业的信息可以发给任何人&#xff0c;普通信息还好&#xff0c;如果是重要机密呢&#xff0c;企业重要信息被发出去后可能会造成一些麻烦&#xff0c;所以可以使用加密系统&#xff0c;对数据进行安全保护&#xff0c;防止泄密问题&#…

一次 K8s Pod 频繁被“驱逐”,结果竟是这样的?

问题描述 某天下午运维反馈说我们这一个pod一天重启了8次&#xff0c;需要排查下原因。一看 Kibana 日志&#xff0c;jvm 没有抛出过任何错误&#xff0c;服务就直接重启了。显然是进程被直接杀了&#xff0c;初步判断是 pod 达到内存上限被 K8s oomkill 了。 Containers: c…

学习软考----数据库系统工程师22

关系运算 基本的关系代数运算 拓展的关系运算 除&#xff1a;需要S连接中属性为C和D的两个元组都与R连接一样&#xff0c;且在R连接中对应的另外的元素完全一致 总结

VBA在Excel中注册登录界面的应用

Excel工作表也可以做一个小程序,登录注册后可以访问或修改。为了简便,没有做复杂的控件,能说明问题就行。可以根据需要添加更多的判断条件,控制注册和访问人数。本次操作对注册没有任何限制,只要注册后就可以根据注册的账号和密码进行访问和修改。注册登录界面截图: 操作…

【数据结构】 顺序表专题

目录 1.顺序表的概念及结构 1.1线性表 1.2顺序表 2.顺序表的分类 2.1静态顺序表 2.2动态顺序表 1.顺序表的概念及结构 1.1线性表 线性表&#xff08;Linear List&#xff09;是数据结构中的一种基本结构&#xff0c;它是一个具有n个数据元素的有限序列。线性表的特点是数…

速卖通新卖家测评攻略:从入门到精通

在电商行业中&#xff0c;测评被广泛认为是提升产品转化率和销量的有效手段。对于速卖通的卖家而言&#xff0c;测评的必要性更是显而易见。测评&#xff0c;本质上与国内电商的补单行为相似&#xff0c;是一种通过增加销量来提升产品权重的方法。 特别是在竞争激烈的类目中&a…

Colibri for Mac v2.2.0 原生无损音频播放器 激活版

Colibri支持所有流行的无损和有损音频格式的完美清晰的比特完美播放&#xff0c;仅使用微小的计算能力&#xff0c;并提供干净和直观的用户体验。 Colibri在播放音乐时使用极少的计算能力。该应用程序使用最先进的Swift 3编程语言构建&#xff0c;BASS音频引擎作为机器代码捆绑…

VS code ESP-IDF 提示“loading ‘build.ninja‘: 系统找不到指定的文件” 的解决方案

最近在搞esp32&#xff0c;使用VS code进行开发&#xff0c;但是当把别人的工程直接导进去的时候编译报错找不到文件&#xff1a; 但是在之前明明已经新建工程成功了&#xff0c;那应该是缺少某些文件吧。在网上找到一种方法就是将文件拷贝到之前新建的文件里面&#xff0c;确…

Wish、Newegg、Allegro卖家如何做测评补单 快速提升产品权重与销量

大部分主流平台卖家都会使用测评补单来增加产品权重、提高销量。经常会有一些平台的卖家咨询我其他平台能否像亚马逊一样通过测评补单来提升曝光。 其实大部分跨境电商都是可以通过补单来增加店铺权重提升产品排名。其实亚马逊相对来说风控是最严的&#xff0c;风控点多达几十…
最新文章