Trying to test a setup for ssh forwarding but keep running into problems.
Here's the setup:
Local machine runs command:
ssh -fNT -v -v -L 8087:127.0.0.1:8077 user@remotehost
and then remote machine runs:
nc -l -p 8077
and then on the local machine:
nc 127.0.0.1 8087 < example.txt
What I expect is to see the contents of example.txt but instead I see this error on the remote machine:
channel 2: open failed: connect failed: Connection refused
From what I understand it throws the error because nothing is listening, but netcat is listening so I'm somewhat confused. My firewall is configured correctly so I'm sure that's not the case.
I'm unsure what is causing this error and any documentation I've found has not adequately explained it.
It ended up working eventually with the same setup. However, I'm still unsure what that error means exactly. To keep the question relevant to others seeking help I am updating it to focus on the error message itself rather than how to configure port forwarding.