SSH over HTTP with ProxyTunnel "Error reading socket: [104] Connection reset by peer"

I try to connect to my SSH server via HTTP through my apache web server, I followed the instructions in manuals such as [1] and [2], the tunnel connects and within ~ 1 minute I get an SSH connection to my server.

However, it looks like there are 60 seconds in the chain, because I get a Socket read error: [104] Connection reset by peer after about 60 seconds. This happens when I run the ssh command as configured, and when I run the proxytunnel command in isolation.

I tried to fix this problem by changing ServerAliveInterval for 30 seconds and including TCPKeepAlive in the .ssh/config file, and putting ProxyTimeout 3600 in the apache configuration that I included below.

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>

Thanks for any help.

[1] http://dag.wiee.rs/howto/ssh-http-tunneling/

[2] http://blog.cppse.nl/apache-proxytunnel-ssh-tunnel

edit: I am running Apache 2.4

+6
source share
1 answer

Since there was no exact question, here is how I fixed this problem for my servers (when I want to access it from any computer around the world):

https://wiki.ubuntuusers.de/shellinabox/

"shell-in-a-box" emulates an ssh shell that can be called from any browser (I tested chrome and firefox).

A good installation tutorial here:

http://www.tecmint.com/shell-in-a-box-a-web-based-ssh-terminal-to-access-remote-linux-servers/

And don't forget to remove the '-localhost-only'

 # if you want to restrict access to shellinaboxd from localhost only SHELLINABOX_ARGS="--o-beep -s /:SSH:172.16.25.125 --localhost-only" 

in the configuration file

 /etc/default/shellinabox 

to access it from outside the network.

0
source

Source: https://habr.com/ru/post/974687/


All Articles