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

后端 未结 8 642
北恋
北恋 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:01

    Posting this to help someone.

    Symptom:

    channel 2: open failed: connect failed: Connection refused
    debug1: channel 2: free: direct-tcpip:
       listening port 8890 for 169.254.76.1 port 8890,
       connect from ::1 port 52337 to ::1 port 8890, nchannels 8
    

    My scenario; i had to use the remote server as a bastion host to connect elsewhere. Final Destination/Target: 169.254.76.1, port 8890. Through intermediary server with public ip: ec2-54-162-180-7.compute-1.amazonaws.com

    SSH local port forwarding command:

    ssh -i ~/keys/dev.tst -vnNT -L :8890:169.254.76.1:8890
    glue@ec2-54-162-180-7.compute-1.amazonaws.com
    

    What the problem was: There was no service bound on port 8890 in the target host. i had forgotten to start the service.

    How did i trouble shoot:

    SSH into bastion host and then do curl.

    Hope this helps.

提交回复
热议问题