SSH -L connection successful, but localhost port forwarding not working “channel 3: open failed: connect failed: Connection refused”

后端 未结 8 612
北恋
北恋 2020-12-02 15:28

My lab runs RStudio on a server. A couple weeks ago, from my cousin\'s house, I successfully ssh\'d into the server and pulled up the server-side RStudio through my local F

相关标签:
8条回答
  • 2020-12-02 16:08

    I used to meet the similar problem because 'localhost' was not available on server when it restarted network service, e.g. 'ifdown -a' but followed by only 'ifup -eo1'. Besides server is not listening to the port, you can also check 'localhost' is available or not.

    ps: Post it just hope someone who has the similar problem may benefit.

    0 讨论(0)
  • 2020-12-02 16:09

    Note: localhost is the hostname for an address using the local (loopback) network interface, and 127.0.0.1 is its IP in the IPv4 network standard (it's ::1 in IPv6). 0.0.0.0 is the IPv4 standard "current network" IP address.

    I experienced this error with a Docker setup. I had a Docker container running on an external server, and I'd (correctly) mapped its ports out as 127.0.0.1:9232:9232. By port-forwarding ssh remote -L 9232:127.0.0.1:9232, I'd expected to be able to communicate with the remote server's port 9232 as if it were my own local port.

    It turned out that the Docker container was internally running its process on 127.0.0.1:9232 rather than 0.0.0.0:9232, and so even though I'd specified the container's port-mappings correctly, they weren't on the correct interface for being mapped out.

    0 讨论(0)
提交回复
热议问题