搭建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
本文作者:鸣昊
本文链接:https://www.cnblogs.com/x602/p/15566676.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步