Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

Reverse SSH Tunnel Question

Wed Dec 10, 2014 6:25 pm

I have a raspberry pi behind a firewall. I found that if I use Reverse SSH Tunnel I am able to access it without opening ports on the Firewall. So I tried it like shown below and it works.

/usr/bin/ssh -R 5001:localhost:22 root@remotehosthere

My problem is that when the raspberry pi is restarted, the command has to be entered again, in order for me to be able to access it again.

I could put the command in cron @reboot, but it prompts for a password.

Is there a way I can automate this thing?


Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Reverse SSH Tunnel Question

Wed Dec 10, 2014 6:33 pm

Use keys instead of passwords : ... -password/

• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere

Posts: 1
Joined: Tue Dec 09, 2014 9:00 pm

Re: Reverse SSH Tunnel Question

Wed Dec 10, 2014 6:41 pm

Have you been able to get the reverse connection (server to Rpi) started?
If so can you show me the verbose output of the following command entered at remotehosthere:

ssh -p 5001 pi@localhost -v

Despite many attempts I could not get the reverse connection working.


Return to “Raspberry Pi OS”