vault backup: 2024-01-17 09:24:07
This commit is contained in:
@@ -1,40 +1,45 @@
|
|||||||
# 安裝
|
# 安裝
|
||||||
```shell
|
```shell
|
||||||
sudo apt-get install vsftpd
|
sudo apt install vsftpd
|
||||||
```
|
```
|
||||||
|
|
||||||
# 設定檔
|
# 設定檔
|
||||||
## `/etc/vsftpd.conf`
|
## `/etc/vsftpd.conf`
|
||||||
```shell
|
```shell
|
||||||
# 不允许匿名访问
|
anonymous_enable=NO # 不能匿名登入
|
||||||
anonymous_enable=NO
|
local_enable=YES
|
||||||
# 设定可以进行写操作
|
write_enable=NO # 不能寫入
|
||||||
write_enable=YES
|
local_umask=022 # default file permissions for uploaded files
|
||||||
# 设定本地用户可以访问
|
chroot_local_user=YES # restricts users to their home directories
|
||||||
local_enable=YES
|
|
||||||
|
|
||||||
# 將所有本機使用者限制在家目錄中,NO 則不限制
|
# PASV mode
|
||||||
chroot_local_user=YES
|
pasv_enable=YES
|
||||||
# 設定vsftpd 使用的PAM 模組為vsftpd
|
pasv_min_port=10000
|
||||||
pam_service_name=vsftpd
|
pasv_max_port=20000
|
||||||
|
|
||||||
# 設定虛擬帳號的主目錄為/vuserconfig
|
|
||||||
user_config_dir=/etc/vsftpd/vuserconfig
|
|
||||||
|
|
||||||
# 設定 FTP 伺服器最大接入客戶端數為 10 個
|
# 設定 FTP 伺服器最大接入客戶端數為 10 個
|
||||||
max_clients=10
|
max_clients=10
|
||||||
# 設定每個 IP 位址最大連線數為 10 個
|
# 設定每個 IP 位址最大連線數為 10 個
|
||||||
max_per_ip=10
|
max_per_ip=10
|
||||||
|
|
||||||
allow_writeable_chroot=YES
|
# Limiting User Login
|
||||||
pasv_enable=YES
|
userlist_enable=YES
|
||||||
pasv_min_port=10000
|
userlist_file=/etc/vsftpd.user_list
|
||||||
pasv_max_port=20000
|
userlist_deny=NO
|
||||||
|
|
||||||
|
user_sub_token=$USER
|
||||||
|
local_root=/home/$USER/ftp
|
||||||
```
|
```
|
||||||
|
|
||||||
# Service control
|
# Service control
|
||||||
|
## Restart
|
||||||
```shell
|
```shell
|
||||||
sudo service vsftpd restart
|
sudo service vsftpd restart
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Status
|
||||||
|
```shell
|
||||||
|
sudo systemctl status vsftpd
|
||||||
|
```
|
||||||
|
|
||||||
# 建立使用者資料庫
|
# 建立使用者資料庫
|
||||||
|
|||||||
Reference in New Issue
Block a user