I'm running a raspberry pi in a remote location, so I setup a reverse ssh tunnel to one of my servers (CentOS 7) using autossh. All works fine, I can use this reverse ssh to login to the Raspberry from the server, but I can't get the server to forward the ssh, so I can not connect to the Raspberry via the server from the laptop, I always get Connection Refused. Firewall on the server has been shut down the GatewayPorts yes has been added to the sshd_config and sshd restarted.
Details:
- On the Raspberry I'm opening the reverse SSh tunnel:
autossh -fNC -g -M 0 -R 2223:localhost:22 [serveruser]@[server] -p2002
- From the server I can ssh into the Raspberry with no problem:
ssh [raspberryuser]@localhost -p2223
- I have added the next to /etc/ssh/sshd_config and restarted sshd service after:
GatewayPorts yes
- I can successfully ssh into the Raspberry from the server:
ssh [raspberryuser]@localhost -p2223
- But when I'm trying to connect from my laptop to the Raspberry through this server:
ssh [raspberryuser]@[server] -p2223 ssh: connect to host [server] port 2223: Connection refused
The firewall on the server has been stopped
SELinux is disabled on the server
I ran out of ideas, so I'm open to suggestions