If you have a VPS cloud it is possible. Get cheap cloud from arubacloud.com.
First off, log in to your remote server and open /etc/ssh/sshd_config
. If it does not already exist add the line:
GatewayPorts clientspecified
Then restart the SSH daemon:
sudo /etc/init.d/ssh restart
# or
sudo service sshd restart
Back on your Android, start your development server or any thing you want to access from anywhere and then in JuiceSSH terminal run the following:
ssh -N -R :3000:localhost:8182 root@vpsipadress
On asking type VPS user's password. That's it. Where Android's local port is 8182
. Anyone now can access it vpsipadress:3000
.
You can apt-get install sshpass
and use passwords of servers in this command:
sshpass -p Password ssh -N -R :3000:localhost:8182 root@vpsipadress
aswell.
autosh
, cron
---- crontab -e
and auto.sh
, too many options.
Update.......
The Best thing on Android is that install Gnuroot Debian. Best Linux for non rooted Adndroid. Install ssh
and sshpass
. And in /etc/rc.local
add this command :
while true; do sshpass -p YOURPASSWORD ssh -N -f -R :3000:localhost:8182 USER@YOURHOST-OR-IP; sleep 3; done
rc.local
will make sure to execute this command on startup. And on disconnect or any kind of change in internet/network, the loop script will try to reconnect it every 3 seconds.
You can also make auto.sh
script:
#!/bin/sh
while true; do sshpass -p YOURPASSWORD ssh -N -f -R :3000:localhost:8182 USER@YOURHOST-OR-IP; sleep 3; done
chmod +x
will make it executeable.
sh auto.sh
If rc.local
won't help install cron:
apt-get install cron
crontab -e
add command: @reboot sh auto.sh
. shif+zz
to save. This cron job will do it on startup.