I have been trying since 2 days to do the following:
I have a windows machine, let's call it A, and a Linux machine called B.
There is a firewall between A and B. I want to connect remotely from the windows machine A to my Linux machine (remote port forwarding to B), and once this is done I want to dynamically port forward connections from Linux machine B to Windows machine A.
I have been doing the following on the Windows machine A:
plink.exe -v -ssh -C -T -N -R 3310:127.0.0.1:22 root@LinuxMachine -pw MyPassword
And on the Linux machine B:
ssh -v -N -D 127.0.0.1:8080 -p 3310 root@127.0.0.1
The goal is to redirect all my traffic through this Windows machine including my browser (using socks4 proxy parameters). I have also changed my proxychain configuration file to point to 127.0.0.1 and port 3310.
When I validate the command on B, I got the following on Windows A machine:
Remote port forwarding from 3310 enabled
Attempting to forward remote port to 127.0.0.1:22
Forwarded port opened successfully
FOrwarded port closed due to local error
And I got the following on Linux B machine:
ssh_exchange_identification: Connection closed by remote host
I have been troubleshooting it but I think I'm lacking a bit on knowledge of how to perform remote port forwarding combined for dynamic port forwarding. My main idea of the issue is that it looks that packets are not going from Linux B to Windows A.
I have been changing a bit the plink.exe command on Windows A, but without success.
Thanks for your help!