0

I need to create a tunnel in a remote MS-windows, so the port 443 in MS-windows is redirected to a remote target on port 443.

What I'm trying to do is this, from my remote server:

ssh -N -R 443:remote.target:443 administrator@windows.source

But I get this error:

Warning: remote port forwarding failed for listen port 443

In the windows server I installed OpenSSH.

The tunnel works if I use the 8443 port in windows, eg:

ssh -N -R 8443:remote.target:443 administrator@windows.source

But I need do do the tunnel with 443. I tried to better configure OpenSSH ("AllowTcpForwarding yes", "PermitTunnel yes" and "GatewayPorts yes" and I tried also to restart the sshd service as an administrator), but it didn't work.

2
  • Are there 3 machines involved? Feb 21, 2020 at 11:19
  • Yes, there is - one server with a service on port 443 to which I have to connect to - my server that is used to do the tunnel - the windows server that needs to connect to the first one and that cannot do directly
    – luandrea
    Feb 21, 2020 at 12:43

1 Answer 1

1

It may be because the port is reserved. Ports below 1024 are reserved on many OSs. To use them you have to have special permission (e.g. be root user).

Try a higher port number. If this works then you know what the problem is. (Only the listening port has to be higher.)

6
  • I was thinking the same, but I need to do the tunnel on that port. I'm already connecting using the administrator account in the Windows server, maybe there is a perticular connection on OpenSSH?
    – luandrea
    Feb 21, 2020 at 12:41
  • Have you tested on another port? That way you will know if this is the problem. Feb 21, 2020 at 15:58
  • Yes, I tested using another port and it is working. I also tried to change some OpenSSH settings, like "AllowTcpForwarding yes", "PermitTunnel yes" and "GatewayPorts yes" and I tried also to restart the sshd service as an administrator, but I didn't notice any difference. The sshd_config file is read correctly, because if I change ssh port, I have to use it to be able to connect.
    – luandrea
    Feb 21, 2020 at 16:07
  • OK. Then edit the question to tell us what does work, and what does not (low numbered ports). Feb 21, 2020 at 16:16
  • I don't see a way to edit the question, I can only add comments under it.
    – luandrea
    Feb 21, 2020 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.