This commit is contained in:
2021-11-14 15:52:46 +08:00
parent 915c231124
commit 1e344dc204
112 changed files with 1039 additions and 1039 deletions

View File

@@ -6,22 +6,22 @@ tags: ["ftp", "vsftp"]
categories: ["storage"]
---
# 环境
## 环境
- CentOS7
- vsftpd
- 关闭 selinux
# 安装 vsftpd 服务
## 安装 vsftpd 服务
```bash
yum install vsftpd
```
# 常用客户端
## 常用客户端
- ftp
- lftp
- curl
# 主动模式
## 主动模式
- 建立控制命令连接
- 客户端连接服务端 21 号端口
@@ -35,7 +35,7 @@ categories: ["storage"]
pasv_enable = no
```
# 被动模式
## 被动模式
- 建立控制命令连接
- 客户端连接服务端 21 号端口
@@ -53,7 +53,7 @@ categories: ["storage"]
pasv_max_port=30999
```
# 匿名用户配置
## 匿名用户配置
```ini
# 控制是否允许匿名用户登入
# 匿名用户使用的登陆名为 ftp 或 anonymous口令为空
@@ -102,8 +102,8 @@ categories: ["storage"]
anon_umask=077
```
# 配置
## 常用配置
## 配置
### 常用配置
```ini
#允许匿名用户登陆
anonymous_enable=YES
@@ -118,7 +118,7 @@ categories: ["storage"]
chroot_list_file=/etc/vsftpd/chroot_list
```
## 允许 vsftpd 匿名用户上传和下载
### 允许 vsftpd 匿名用户上传和下载
- 创建匿名用户登陆目录
```bash
mkdir -p /var/ftp/pub
@@ -141,7 +141,7 @@ categories: ["storage"]
anon_umask=022
```
## 本地用户登陆
### 本地用户登陆
- 修改 vsftpd.conf
```
# 不允许匿名用户登入
@@ -163,7 +163,7 @@ categories: ["storage"]
chroot_local_user=YES
```
## 创建 ftp 专用账户
### 创建 ftp 专用账户
- 创建用户 ftpuser1
```bash
useradd -s /sbin/nologin ftpuser1
@@ -181,6 +181,6 @@ categories: ["storage"]
chroot_local_user=YES
```
# 参考
## 参考
- [vsftpd 详细配置](http://vsftpd.beasts.org/vsftpd_conf.html)