Score:0

SSH remote forward success but test from remote site not working

us flag

Took me a while to figure this out, but finally got remote port forwarding to work with ssh as follows:

ssh -N -i /etc/ssh/id_rsa [email protected] -R 8080:localhost:80 -C -v

The local server uses a private key to connect to the remote server which has a public key configured. Able to authenticate successfully, no errors in the log. The last line that ssh prints is:

debug1: remote forward success for: listen 8080, connect localhost:80

I tried testing this from my public site, as follows:

However, nothing happens - still see this line:

debug1: remote forward success for: listen 8080, connect localhost:80

If I test locally on the remote server using http://127.0.0.1:8080, it works fine.

NOTE: The following is set in sshd_config on the remote server:

  1. AllowTcpForwarding yes
  2. GatewayPorts yes

Not sure what I am missing...

Score:0
jp flag

Quote from man ssh

By default, TCP listening sockets on the server will be bound to the loopback interface only.This may be overridden by specifying a bind_address. An empty bind_address, or the address ‘*’, indicates that the remote socket should listen on all interfaces. Specify‐ ing a remote bind_address will only succeed if the server's GatewayPorts option is enabled (see sshd_config(5)).

us flag
Thanks, this was already enabled in sshd_config. Updated the question to reflect this.
us flag
I checked my sshd_config again and between restoring VM's and stuff, looks like I forgot to redo this step.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.