爱生活,爱分享


socat 端口映射转发

haiten 2025-09-17 3439浏览 0条评论
首页/正文
分享到: / / / /

nano /root/socat.sh

#!/bin/bash
nohup socat -lf socat1.log TCP-LISTEN:40101,fork TCP:127.0.0.1:1820 >/dev/null 2>&1 &
nohup socat -lf socat2.log TCP-LISTEN:40102,fork TCP:127.0.0.1:3306 >/dev/null 2>&1 &
nohup socat -lf socat3.log TCP-LISTEN:40103,fork TCP:127.0.0.1:1883 >/dev/null 2>&1 &

crontab -e

50 11 * * * /usr/bin/nohup /bin/bash /root/socat.sh > /root/socat.log 2>&1 &

最后修改:2025-09-17 03:56:19 © 著作权归作者所有
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付

上一篇

发表评论

说点什么吧~

评论列表

还没有人评论哦~赶快抢占沙发吧~