Linux下tinyPortMapper端口转发的使用

发布于 2019-12-20  257 次阅读


端口转发还是经常用的,比如一台国外服务器,然后用香港之类的中转下提升访问速度

//首先创建个文件夹
mkdir tinyPortMapper && cd tinyPortMapper
//访问https://github.com/wangyu-/tinyPortMapper/releases查看最新的版本号
wget -N --no-check-certificate https://github.com/wangyu-/tinyPortMapper/releases/download/20180224.0/tinymapper_binaries.tar.gz
tar -xzf tinymapper_binaries.tar.gz
//解压后(uname -a)命令查看系统位数,判断是32位还是64位,将对应文件改为tinymapper
mv tinymapper_amd64 tinymapper
chmod +x tinymapper

后台运行

nohup ./tinymapper -l [本地服务器主网卡绑定IP:端口] -r [目标IP:目标端口] -t -u > /tmp/tinymapper.log 2>&1 &    

开机启动的话利用rc.local

sed -i '$i\nohup /root/tinyPortMapper/tinymapper -l 0.0.0.0:3389 -r 12.34.56.78:5889 -t -u > /tmp/tinymapper.log 2>&1 &' /etc/rc.local

LoneKing