Good day, I'm trying to create a reverse ssh tunnel with my university's remote server. I run the following command on my laptop:
< home >$ ssh -R 9999:localhost:9190 my_user@school_server.edu
I then open another terminal and run
< home >$ nc -l 9190
And on the terminal where I created the tunnel, after logging in, I run
< university >$ nc localhost 9999
When I try this on other computers, I get a connection without a problem between the remote server and the local computer, but on my laptop, I get
< university >$ connect_to localhost port 9190: failed.
When I run the nc command from the remote server.
I have both MacOS as well as Manjaro installed on my laptop, but the problem occurs with both, so it's not a firewall or OS network configuration problem. I've tried using a different network and the problem persists. I have just tried doing the exact same thing with my sister's laptop and it works, and my classmates can do it as well without a problem, so the remote server shouldn't be the problem.
Any idea of what might be causing an issue like this one? Thank you.
EDIT: I forgot to mention, the non-reverse tunnel works perfectly.
More info: Running with the -v flag outputed the following when trying to connect:
debug1: client_input_channel_open: ctype forwarded-tcpip rchan 3 win 2097152 max 32768
debug1: client_request_forwarded_tcpip: listen localhost port 9999, originator 127.0.0.1 port 34590
debug1: connect_next: host 127.0.0.1 ([127.0.0.1]:9190) in progress, fd=9
debug1: channel 1: new [127.0.0.1]
debug1: confirm forwarded-tcpip
debug1: channel 1: connection failed: Connection refused
connect_to 127.0.0.1 port 9190: failed.
debug1: channel 1: free: 127.0.0.1, nchannels 2
ssh
with the "-v" flag to print debugging info:ssh -v -R ...
. Ssh will print more detail about why the connection to 9190 is failing.home:$ command1
,unversity:$ command2
localhost
can mean::1
(ipv6) rather than127.0.0.1
(ipv4). Can you replace everywhere localhost with 127.0.0.1 and try again?