I need to establish a permanent ssh tunnel between private server behind firewall and a public server so that I can ssh into private server anytime via the public server.
When I manually execute this in private server,
ssh -R 6666:localhost:22 username@public_host
everything works fine. But when I put this line into crontab -e
so that the tunnel will be automatically re-established upon reboot, it does not work. Any idea what went wrong?
Note: public/private key pair between servers already set and working fine.
/usr/bin/ssh -R 6666:localhost:22 username@public_host
work?