搭建FTP反向代理/透明代理


背景

因服务器要搬迁,之前ftp提供商加的老机房的白名单,需要再加一遍新的,但是要求白名单只能加一个公网ip,但是现服务在k8s跑,通过net访问外网没有具体的公网ip;

解决方法

找一台有固定公网ip的服务器搭建 ftp代理,应用pod连接代理地址,实现ftp连接 (可先在已有白名单的服务器上搭建代理测试)

部署 ftp.proxy

#下载
wget http://www.ftpproxy.org/download/ftpproxy-current.tgz
#安装编译依赖 
yum  install ctags -y
#解压编译
tar -xvf ftpproxy-current.tgz
cd ftpproxy-1.2.3/   #文件名请自行修改
make
mkdir /usr/local/man -p
sudo make install

/usr/local/sbin/ftp.proxy -D 12580 192.168.1.1:10086
#192.168.1.1:10086 是ftp的地址端口
#12580  是本机代理的端口
#其他服务器测试连接
ftp 
ftp> open 10.101.18.139 12580
Connected to 10.101.18.139 (10.101.18.139).
220 server ready - login please
Name (10.101.18.139:root): test
331 password required
Password:
230 login accepted
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (10,101,18,139,128,252)
150 Here comes the directory listing.
dr-xr-xr-x   13 1001     1001         4096 May 31  2017 test_home

参考文档:https://best33.com/95.moe
搭建ftp:https://www.cnblogs.com/x602/p/13793955.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM