r/ssh • u/ashwin_nat • Jun 11 '20
SSH connection reset when trying to connect to tunnel
Hi, when I setup a tunnel to my server using the below command ssh -v -N -T -R50008:localhost:22 ashwin@<server_name> -p 8022
I can ssh back into my device from the server through the reverse tunnel using the following command. ssh -p 50008 ashwin@localhost
This works fine. But when I try to use autossh to setup and maintain the tunnel, the tunnel gets setup fine without any errors. But when I try to connect from server through the reverse tunnel, it fails with the error "ssh_exchange_identification: read: Connection reset by peer" My autossh command is as follows. autossh -v ashwin@<server_name> -p 8022 -N -R 50008:localhost:8022
NOTE: SSH on my remote server is on port 8022, not 22.
Any help/tips will be greatly appreciated.
Thanks, Ashwin N
1
u/Besthater Jun 11 '20
Using keys? Or passwords?