我试图通过HTTP连接到我的SSH服务器,通过我的apache web服务器,我按照[1]和[2],隧道连接,约1分钟,我得到一个SSH连接到我的服务器。使用ProxyTunnel通过HTTP进行的SSH“套接字读取错误:[104]通过对等方重置连接”
但是,似乎在链中的某个位置有60秒的超时时间,因为我在约60秒后收到错误Socket read error: [104] Connection reset by peer
。当我运行配置的ssh命令并且单独运行proxytunnel
命令时,会发生这种情况。
我试图通过改变ServerAliveInterval
到30秒,并在.ssh/config
文件使TCPKeepAlive
,以及投入Apache的配置一个ProxyTimeout 3600
,其下面我有解决这个问题。
ProxyRequests On AllowConnect 22 ProxyTimeout 3600 <Proxy *> Order deny,allow Deny from all </Proxy> <ProxyMatch 127.0.0.1> Order deny,allow Allow from all </ProxyMatch>
感谢您的帮助。
[1] http://dag.wiee.rs/howto/ssh-http-tunneling/
[2] http://blog.cppse.nl/apache-proxytunnel-ssh-tunnel
编辑:我正在运行的Apache 2.4