SSH tunnelling to remote a server

I need to create an SSH tunnel, forwarding specific port to use a service available on a remote server. I couldn’t find an Action in the market.

What are the available solutions? I’ve tried the following to no avail: Created two steps.

In one I setup all the SSH details and created the SSH tunnel to my remote server
try to ping / access the service

- name: Creating SSH tunnel
run: |
# created SSH stuff..
ssh -L 4873:192.168.0.10:4873 remote-server-details -T &

- name: ping the remote service
run: |
telnet localhost 4873

But unfortunately in the second step I cannot ping the first one despite the tunnel is created successfully.

You can try the following checks:

  1. Ping the remote server to verify if the runner host can communicate over the network with the remote server, for example ping 192.168.0.10 in your case.

  2. Use the following commands to check if a port is open on your localhost, for example  4873 in your case.

On Windows:

netstat -na | findstr "4873"

On Linux and macOS:

netstat -a | grep -i "4873"

Hi,

I have a similar issue, I launch the tunnel to a jump box, it’s to a postgres db on port 5432 and background it, but I can’t make any connections to it but locally on my machine it works fine.

Is port forwarding blocked in any way?

Yusuf