切换导航
首页
技术问答
编程语言
前端开发
移动开发
开发工具
程序设计
行业应用
CMS系统
服务器
频道导航
▸ PHP
▸ Java
▸ Java SE
▸ Python
▸ C#
▸ C&C++
▸ Ruby
▸ VB
▸ asp.Net
▸ Go
▸ Perl
▸ netty
▸ Django
▸ Delphi
▸ Jsp
▸ .NET Core
▸ Spring
▸ Flask
▸ Springboot
▸ SpringMVC
▸ Lua
▸ Laravel
▸ Mybatis
▸ Asp
▸ Groovy
▸ ThinkPHP
▸ Yii
▸ swoole
▸ HTML
▸ HTML5
▸ JavaScript
▸ CSS
▸ jQuery
▸ Bootstrap
▸ Angularjs
▸ TypeScript
▸ Vue
▸ Dojo
▸ Json
▸ Electron
▸ Node.js
▸ extjs
▸ Express
▸ XML
▸ ES6
▸ Ajax
▸ Flash
▸ Unity
▸ React
▸ Flex
▸ Ant Design
▸ Web前端
▸ 微信小程序
▸ 微信公众号
▸ iOS
▸ Android
▸ Swift
▸ Hybrid
▸ Cocos2d-x
▸ Flutter
▸ Xcode
▸ Silverlight
▸ cocoa
▸ Cordova
前端之家
CentOS
CentOS 7.2 安装和配置 FTP 服务器
CentOS 7.2 安装和配置 FTP 服务器
2020-07-01
CentOS
前端之家
前端之家
收集整理的这篇文章主要介绍了
CentOS 7.2 安装和配置 FTP 服务器
,
前端之家
小编觉得挺不错的,现在分享给大家,也给大家做个参考。
1. 安装vsftpd
1
2
3
4
5
6
7
8
9
@H_
301
_22@ @H_
502
_23@
1
2
3
4
5
6
7
8
9
@H_
301
_22@
#安装vsftpd
yum install -y vsftpd
#设置开机启动
systemctl enable vsftpd.service
# 重启
service vsftpd restart
# 查看vsftpd服务的状态
systemctl status vsftpd.service
2. 配置vsftpd.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@H_
301
_22@ @H_
502
_23@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@H_
301
_22@
#备份
配置文件
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
#执行以下命令
sed -i "s/anonymous_enable=YES/anonymous_enable=NO/g" '/etc/vsftpd/vsftpd.conf' sed -i "s/
#anon_upload_enable=YES/anon_upload_enable=NO/g" '/etc/vsftpd/vsftpd.conf'
sed -i "s/
#anon_mkdir_write_enable=YES/anon_mkdir_write_enable=YES/g" '/etc/vsftpd/vsftpd.conf'
sed -i "s/
#chown_uploads=YES/chown_uploads=NO/g" '/etc/vsftpd/vsftpd.conf'
sed -i "s/
#async_abor_enable=YES/async_abor_enable=YES/g" '/etc/vsftpd/vsftpd.conf'
sed -i "s/
#ascii_upload_enable=YES/ascii_upload_enable=YES/g" '/etc/vsftpd/vsftpd.conf'
sed -i "s/
#ascii_download_enable=YES/ascii_download_enable=YES/g" '/etc/vsftpd/vsftpd.conf'
sed -i "s/
#ftpd_banner=Welcome to blah FTP service./ftpd_banner=Welcome to FTP service./g" '/etc/vsftpd/vsftpd.conf'
#
添加
下列
内容
到vsftpd.conf末尾
use_localtime
=YES
listen_port
=21
chroot_local_user
=YES
idle_session_timeout
=300
guest_enable
=YES
guest_username
=vsftpd
user_config_dir
=/etc/vsftpd/vconf
data_connection_timeout
=1
virtual_use_local_privs
=YES
pasv_min_port
=10060
pasv_max_port
=10090
accept_timeout
=5
connect_timeout
=1
3. 建立
用户
文件
1
2
3
4
5
6
@H_
301
_22@ @H_
502
_23@
1
2
3
4
5
6
@H_
301
_22@
#第一行
用户名
,第二行密码,不能使用root为
用户名
vi /etc/vsftpd/virtusers chris
123456
chang
123456
4.
生成
用户
数据
文件
1
2
3
4
5
@H_
301
_22@ @H_
502
_23@
1
2
3
4
5
@H_
301
_22@db_load -T -t
hash
-f
/etc/vsftpd/virtusers /etc/vsftpd/virtusers.db
#设定PAM验证
文件
,并指定对虚拟
用户
数据库
文件
进行读取
chmod
600
/etc/vsftpd/virtusers.db
5.
修改
/etc/pam.d/vsftpd
文件
1
2
3
4
5
6
7
8
9
10
11
12
@H_
301
_22@ @H_
502
_23@
1
2
3
4
5
6
7
8
9
10
11
12
@H_
301
_22@
#
修改
前先备份
cp
/etc/pam
.d
/vsftpd /etc/pam
.d
/vsftpd
.bak
# 将auth及account的所有配置行均注释掉
vi /etc/pam
.d
/vsftpd auth sufficient /lib64/security/pam_userdb
.so
db=/etc/vsftpd/virtusers account sufficient /lib64/security/pam_userdb
.so
db=/etc/vsftpd/virtusers
# 如果系统为32位,上面改为lib
6. 新建系统
用户
vsftpd,
用户
目录为/home/vsftpd
1
2
3
@H_
301
_22@ @H_
502
_23@
1
2
3
@H_
301
_22@
#
用户
登录
终端设为/bin/false(即:使之不能
登录
系统)
useradd vsftpd
-d
/home/vsftpd
-s
/bin/
false
chown -R vsftpd:vsftpd /home/vsftpd
7.建立虚拟
用户
个人
配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@H_
301
_22@ @H_
502
_23@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@H_
301
_22@mkdir /etc/vsftpd/vconf cd /etc/vsftpd/vconf
#这里建立两个虚拟
用户
配合
文件
touch chris chang
#建立
用户
根目录
mkdir -p /home/vsftpd/chris/
#编辑chris
用户
配置文件
,
内容
如下,其他
用户
类似
vi chris
local_root
=/home/vsftpd/chris/
write_enable
=YES
anon_world_readable_only
=NO
anon_upload_enable
=YES
anon_mkdir_write_enable
=YES
anon_other_write_enable
=YES
8. 防火墙设置
1
2
3
4
@H_
301
_22@ @H_
502
_23@
1
2
3
4
@H_
301
_22@vi /etc/sysconfig/iptables
#编辑iptables
文件
,
添加
如下
内容
,开启21端口
-A INPUT -
m
state
--
state
NEW -
m
tcp -p tcp --dport
21
-j ACCEPT
9. 重启vsftpd服务器
1
@H_
301
_22@ @H_
502
_23@
1
@H_
301
_22@service vsftpd restart
10. 使用CuteFtp/FlashFTP等软件连接测试
上一篇:CentOS相关资源链接
下一篇:CentOS7.2部署FTP
猜你在找的CentOS相关文章
Centos7离线安装gcc4.8
有时候CentOS工作在无互联网的环境下,需要在离线环境下安装一些组件,这次实现的是模拟在...
作者:踏平扶桑 时间:2024-09-29
CentOS7离线安装devtoolset-9并编译redis6.0.5
首先参照https://www.cnblogs.com/wdw984/p/13330074.html,来进行如何安装Centos和离线下...
作者:踏平扶桑 时间:2024-09-29
使用Nginx在80端口上代理多个.NET CORE网站
有两个.NET CORE3.1网站部署在CentOS7上(内网IP是192.168.2.32),现在想实现访问http://...
作者:踏平扶桑 时间:2024-09-29
CentOS7中配置vsftpd
1、yum -y install vsftpd 安装vsftpd 2、配置vsftpd的配置文件(/etc/vsftpd/vsftpd.conf...
作者:踏平扶桑 时间:2024-09-29
CentOS7离线安装Mysql8.0
首先去mysql官网下载mysql的离线rpm安装包(https://downloads.mysql.com/archives/commun...
作者:踏平扶桑 时间:2024-09-29
CentOS中增加网络连接数的方法
CentOS默认对外访问,发起的TCP链接总数小于28232个。 可以通过以下命令的结果计算出来 $ ...
作者:踏平扶桑 时间:2024-09-29
VMware安装Centos7虚拟机
首先安装虚拟机很简单,所以呢,具体的安装过程就引用别人的博客,这篇文字很详细,引用之...
作者:前端之家 时间:2021-02-27
[Linux] 解决CentOS下Requires: libjson-c.so错误
当安装某些rpm包的时候 , 会爆出这个错误 Requires: libjson-c.so json-c是c语言下的json库...
作者:前端之家 时间:2021-02-06
阿里云centos7安装mysql8数据库
linux系统安装mysql8
作者:前端之家 时间:2021-01-10
centos安装mysql
一、安装 二、修改密码 三、修改远程连接权限(为了使用navicat)
作者:前端之家 时间:2020-12-03
编程分类
Linux
Windows
CentOS
Ubuntu
Nginx
WebService
Scala
Memcache
Apache
Redis
Docker
Bash
Azure
Tomcat
LNMP
Shell
数据结构
服务器运维
网络安全
最新文章
• Centos7离线安装gcc4.8
• CentOS7离线安装devtoolse
• 使用Nginx在80端口上代理多
• CentOS7中配置vsftpd
• CentOS7离线安装Mysql8.0
• CentOS7下安装RabbitMQ
• CentOS中增加网络连接数的
• VMware安装Centos7虚拟机
• [Linux] 解决CentOS下Requ
• 阿里云centos7安装mysql8数
热门标签
更多 ►
xebug
nodemon
docker-copy
dcos
elasticsearc
windows-cont
docker-windo
docker-aws
amazon-cloud
envoyproxy
hashicorp-va
swisscomdev
kafka-python
zscaler
photon-os
docker-swarm
kamon
google-cloud
concourse
wso2-am
persistent-v
api-manager
process-mana
manjaro
jenkins-work
hypriot
remoteapi
keystonejs
bitcoind
bitcoin-test