vsftp被动模式nginx代理
vsftp被动模式nginx代理
-
vsftp配置,添加如下配置项
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
pasv_enable=YES
pasv_min_port=30000
pasv_max_port=30001
pasv_address=10.8.8.207
port_enable=YES
connect_from_port_20=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
dual_log_enable=YES
log_ftp_protocol=YES
-
在创建一个ftp用户即可
-
nginx代理配置项
stream {
upstream ftp_command {
server 10.8.8.9:21 max_fails=1 fail_timeout=10s;
}
upstream ftp_data1 {
server 10.8.8.9:30000 max_fails=1 fail_timeout=10s;
}
upstream ftp_data2 {
server 10.8.8.9:30001 max_fails=1 fail_timeout=10s;
}
server {
listen 21;
proxy_pass ftp_command;
}
server {
listen 30000;
proxy_pass ftp_data1;
}
server {
listen 30001;
proxy_pass ftp_data2;
}
}
-
验证
[root@volte-uat2 offcial]# ftp 10.8.8.9
Connected to 10.8.8.9 (10.8.8.9).
220 (vsFTPd 3.0.2)
Name (10.8.8.9:root): test
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (0,0,0,0,117,49).
150 Here comes the directory listing.
-rw-r--r-- 1 1007 1007 32 Sep 24 06:46 FxhOHCnvx8.txt
-rw-r--r-- 1 1007 1007 3857 Sep 24 06:46 index.html
-rw-r--r-- 1 1007 1007 548444 Sep 24 06:39 libshout.tar.gz
-rw-r--r-- 1 0 0 1475 Sep 24 06:39 passwd
226 Directory send OK.
ftp>
ftp>
200.html aos/ common/ FxhOHCnvx8.txt imgs-forgotpassword/ imgs-v2.1/ index.html_bakqnt8 qncc/ svg/
agent/ client/ config.js highlight.min.css imgs-platform/ imgs-v2.2/ media/ sdk/ vpm/
agent_sdk/ client_sdk/ favicon.ico imgs-entrance/ imgs-site/ index.html _nuxt/ statics/
ftp> put index.html
local: index.html remote: index.html
227 Entering Passive Mode (0,0,0,0,117,48).
150 Ok to send data.
226 Transfer complete.
3857 bytes sent in 4.8e-05 secs (80354.16 Kbytes/sec)
ftp> ls
227 Entering Passive Mode (0,0,0,0,117,49).
150 Here comes the directory listing.
-rw-r--r-- 1 1007 1007 32 Sep 24 06:46 FxhOHCnvx8.txt
-rw-r--r-- 1 1007 1007 3857 Sep 24 07:05 index.html
-rw-r--r-- 1 1007 1007 548444 Sep 24 06:39 libshout.tar.gz
-rw-r--r-- 1 0 0 1475 Sep 24 06:39 passwd
226 Directory send OK.
ftp> get libshout.tar.gz
local: libshout.tar.gz remote: libshout.tar.gz
227 Entering Passive Mode (0,0,0,0,117,49).
150 Opening BINARY mode data connection for libshout.tar.gz (548444 bytes).
226 Transfer complete.
548444 bytes received in 0.0116 secs (47340.87 Kbytes/sec)
本文由 mdnice 多平台发布
原文地址:https://blog.csdn.net/zhao138969/article/details/142491797
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!