1、配置vsftpd
vi /etc/vsftpd/vsftpd.conf 修改以下配置: listen_ipv6=NO listen=YES connect_from_port_20=NO 追加以下配置: pasv_enable=YES pasv_min_port=40024 pasv_max_port=40027 pasv_promiscuous=YES pasv_addr_resolve=YES pasv_address=server.chip-cloud.com reverse_lookup_enable=NO
2、配置frpc
vi /opt/frpc/frpc.ini 追加以下配置(注意[ftp40024]不可重复): [ftp40024] type = tcp local_ip = 127.0.0.1 local_port = 40024 remote_port = 40024 [ftp40025] type = tcp local_ip = 127.0.0.1 local_port = 40025 remote_port = 40025 [ftp40026] type = tcp local_ip = 127.0.0.1 local_port = 40026 remote_port = 40026 [ftp40027] type = tcp local_ip = 127.0.0.1 local_port = 40027 remote_port = 40027
3、重启服务
重启frpc
systemctl restart frpc
重启vsftpd
systemctl restart vsftpd
4、查看服务状态
[root@taojifang ~]# systemctl status vsftpd ● vsftpd.service - Vsftpd ftp daemon Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled) Active: active (running) since 三 2021-11-03 19:48:24 CST; 3s ago Process: 42285 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS) Main PID: 42287 (vsftpd) Tasks: 1 CGroup: /system.slice/vsftpd.service └─42287 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf 11月 03 19:48:24 taojifang systemd[1]: Starting Vsftpd ftp daemon... 11月 03 19:48:24 taojifang systemd[1]: Started Vsftpd ftp daemon. [root@taojifang ~]# systemctl status frpc ● frpc.service - frp client Loaded: loaded (/usr/lib/systemd/system/frpc.service; enabled; vendor preset: disabled) Active: active (running) since 三 2021-11-03 19:48:19 CST; 18s ago Main PID: 42222 (frpc) Tasks: 5 CGroup: /system.slice/frpc.service └─42222 /opt/frpc/frpc -c /opt/frpc/frpc.ini 11月 03 19:48:19 taojifang systemd[1]: Started frp client. 11月 03 19:48:19 taojifang frpc[42222]: 2021/11/03 19:48:19 [I] [service.go:304] [db4ec8fb92e95196] login to server success, get run id [db4ec8fb92e95196], server udp port [0] 11月 03 19:48:19 taojifang frpc[42222]: 2021/11/03 19:48:19 [I] [proxy_manager.go:144] [db4ec8fb92e95196] proxy added: [172.18.0.19 ftp40024 ftp40025 ftp40026 ftp40027] 11月 03 19:48:19 taojifang frpc[42222]: 2021/11/03 19:48:19 [I] [control.go:180] [db4ec8fb92e95196] [ftp40024] start proxy success 11月 03 19:48:19 taojifang frpc[42222]: 2021/11/03 19:48:19 [I] [control.go:180] [db4ec8fb92e95196] [172.18.0.19] start proxy success 11月 03 19:48:19 taojifang frpc[42222]: 2021/11/03 19:48:19 [I] [control.go:180] [db4ec8fb92e95196] [ftp40025] start proxy success 11月 03 19:48:19 taojifang frpc[42222]: 2021/11/03 19:48:19 [I] [control.go:180] [db4ec8fb92e95196] [ftp40026] start proxy success 11月 03 19:48:19 taojifang frpc[42222]: 2021/11/03 19:48:19 [I] [control.go:180] [db4ec8fb92e95196] [ftp40027] start proxy success