0

I'm trying to setup ssh over https using apache and proxytunnel on Ubuntu 18.04, but I want the proxy server to be the same as the ssh server.

I have apache going, and from netstat and the output of ssh -vvvv, it looks like I'm successfully connecting to the apache server as after awhile it says HTTP return code: 503 Service Unavailable and netstat shows an established connection between my laptop and the server. It looks like it is getting hung up trying to connect to itself over ssh.

Line from netstat: tcp 0 1 192.168.2.195:51156 public_ip:22 SYN_SENT 24246/apache2

It gets stuck here until it eventually returns bad request. The server is behind a NAT, so that may be contributing to the issue.

I was wondering if there is an elegant way to have the server connect to localhost instead of having it connect to the router and get reforwarded back to the server

Thanks in advance, let me know if you need more info.

  • Unless i'm missing something, the duplicate I linked above should explain your issue. You say it's trying to 'connect to itself' but according to your netcat (netstat?), it is not trying to connect to itself. It's trying to connect to the public IP which lives on another device and forwards those packets after changing the address to your server's actual address. The problem with that is the device that has the public address has that assigned to it's internet interface. You're trying to connect to that address using a LAN interface instead. Many possible fixes but the easiest is don't. –  Oct 23 '19 at 23:46
  • This is essentially what I am trying to achieve, but I was wondering if there is a more elegant way to get the same result without connecting to the router then getting forwarded back to the server. Also yes I meant netstat I have no idea why I typed netcat – BeyondPerception Oct 24 '19 at 01:17

0 Answers0