establish reverse ssh from yun to remote server

I have this command line to establish a reverse ssh connection to my remote server.

ssh -R 20022: -R 20080: -o ServerAliveInterval=30 -o ServerAliveCountMax=6 -i /root/.ssh/id_rsa.db

It is working properly using the terminal, but i want to use the Process.runShellCommand() for this and I can't make it work. Unable to establish the connection without any error.

You have to run a command to hold the connection open. Try adding "ping" or something similar at the end. ssh works differently if called in a TTY or in scripts.