开发tcp 内网穿透时遇到了问题

先前已成功代理了http请求看这里,那时没有走tcp代理。

现在想代理tcp上的任何协议(除了http,用tcp代理http会有粘包问题),已成功代理了mysql,现在想代理ssh.

服务器开了个9504 端口,代理

[
            'type'=>'tcp',
            'local_ip'=> '10.8.0.9',
            'local_port'=> 22,//

        ]

测试的时候发现

ssh -p 9504  jcc@47.96.15.116

登录不上,输出

(base)~ ssh -p 9504  jcc@47.96.15.116
Bad packet length 1397966893.
ssh_dispatch_run_fatal: Connection to 47.96.15.116 port 9504: message authentication code incorrect
(base)~

本地运行

 ssh jcc@10.8.0.9

成功登录

(base)~  ssh jcc@10.8.0.9

Synology strongly advises you not to run commands as the root user, who has
the highest privileges on the system. Doing so may cause major damages
to the system. Please note that if you choose to proceed, all consequences are
at your own risk.

jcc@DS220j:~$

ssh 代理可能并不像成功连接tcp后,在tcp上读写数据就好了,好像要交换公钥私钥验证什么的,对这一块的验证不太懂。

不知道用tcp怎么去代理ssh,或者用php去代理ssh该怎么实现呢?

Make everything simple instead of making difficulties as simple as possible
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
jcc123
最佳答案

已解决

(base)~ ssh -p 9504  jcc@47.96.15.116

Synology strongly advises you not to run commands as the root user, who has
the highest privileges on the system. Doing so may cause major damages
to the system. Please note that if you choose to proceed, all consequences are
at your own risk.

jcc@DS220j:~$

调试的时候发现多发送了一次请求

file

2年前 评论
讨论数量: 1
jcc123

已解决

(base)~ ssh -p 9504  jcc@47.96.15.116

Synology strongly advises you not to run commands as the root user, who has
the highest privileges on the system. Doing so may cause major damages
to the system. Please note that if you choose to proceed, all consequences are
at your own risk.

jcc@DS220j:~$

调试的时候发现多发送了一次请求

file

2年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!