Setting up a reverse-ssh session through double NAT so I can communicate back. It absolutely works perfect while I'm in an active console session, but I can't seem to get it to work automatically from boot out of /etc/rc.local.
The script definitely get's executed because I see the process, but when I do a netstat, I see that the session is CLOSE_WAIT. I also get "connection refused" from my SSH server (remote box).
I can ssh back into the yun, and execute the shell script in my active session, and it then gets ESTABLISHED connection and I can connect from my ssh server.
Here's a copy of the shell script minus my credentials:
sshpass -p "mypassword" ssh -Rfy 12345:localhost:22 email@example.com/12345
Note I've got the -f flag for ssh to run in background after auth. I've even attempted to place it in the crontab with no luck.
Any guidance is appreciated.