jojo_angelov
Posts: 38
Joined: Mon Jan 06, 2014 1:59 am

How to SSH into pi using Tethering from smartphone

Sat Nov 15, 2014 10:32 pm

So I am in need of finding a way to be able to SSH into the Rpi from anywhere. The pi will be connected to a smartphone's tethered connection. I am wondering what would be required for this to happen?

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: How to SSH into pi using Tethering from smartphone

Sat Nov 15, 2014 10:40 pm

I can see a couple of problems here:
1) You won't know the IP address of the phone that your telco has assigned it,
2) I doubt any other ports will be open/forwarded apart from mail and http/https

jojo_angelov
Posts: 38
Joined: Mon Jan 06, 2014 1:59 am

Re: How to SSH into pi using Tethering from smartphone

Sat Nov 15, 2014 10:52 pm

If I assume that I will have knowledge of the IP address of the smartphone, say I get it beforehand, how would I fix the problem with port-forwarding? Is the port-forwarding going to be problematic on the pi or on the phone itself?

User avatar
default_user8
Posts: 678
Joined: Mon Nov 18, 2013 3:11 am

Re: How to SSH into pi using Tethering from smartphone

Sun Nov 16, 2014 12:01 am

Cell providers don't usually allow port forwarding except for business customers if at all. Finding your phones ip address is actually easy, look in settings under about, then ststus it should be listed there.
Two heads are better than one, unless one's a goat head.

plugwash
Forum Moderator
Forum Moderator
Posts: 3476
Joined: Wed Dec 28, 2011 11:45 pm

Re: How to SSH into pi using Tethering from smartphone

Sun Nov 16, 2014 12:07 am

I've never seen a phone with an IP for port forwarding. You may be able to do it from the command line on a rooted andriod using iptables directly but I don't know for sure. And even if you do most cellphone providers at least round here have ISP level NAT anyway.

If you have a machine on a fixed internet connection with a public IP your best option is probablly to set up a VPN from the Pi to the machine with the public IP using openvpn or similar.

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: How to SSH into pi using Tethering from smartphone

Sun Nov 16, 2014 12:41 am

default_user8 wrote:Cell providers don't usually allow port forwarding except for business customers if at all. Finding your phones ip address is actually easy, look in settings under about, then ststus it should be listed there.
I assumed the OP was away from their phone (pi tethered to phone at home, accessing from somewhere else), so that wouldn't have been an option.

gandar
Posts: 215
Joined: Sat Feb 01, 2014 5:45 pm

Re: How to SSH into pi using Tethering from smartphone

Sun Nov 16, 2014 5:38 pm

Not to discourage and I hope you find an answer... I tried various methods for days and couldn't get this to work due to cell network pry forwarding restrictions.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: How to SSH into pi using Tethering from smartphone

Sun Nov 16, 2014 6:10 pm

Most mobile broadband companies don't use global IP addresses for their customers phones and devices, they use private addresses and NAT (much like what a typical fixed router does). You cannot directly access them from the outside world. You need some form of 3rd party magic like a VPN or something.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

jojo_angelov
Posts: 38
Joined: Mon Jan 06, 2014 1:59 am

Re: How to SSH into pi using Tethering from smartphone

Mon Nov 17, 2014 1:40 pm

Thank you all for these suggestions. I am wondering what you guys think might provide this functionality?
For the pi to connect to a "movable" internet connection ( not tethering, but how about one of those Verizon Mobile hotspot), and then someone ssh's into it from, say another location ?

User avatar
default_user8
Posts: 678
Joined: Mon Nov 18, 2013 3:11 am

Re: How to SSH into pi using Tethering from smartphone

Mon Nov 17, 2014 1:43 pm

No difference, still a mobile connection. You should be able to create a reverse ssh connection though.
Two heads are better than one, unless one's a goat head.

jojo_angelov
Posts: 38
Joined: Mon Jan 06, 2014 1:59 am

Re: How to SSH into pi using Tethering from smartphone

Mon Nov 17, 2014 1:56 pm

default_user8 wrote:No difference, still a mobile connection. You should be able to create a reverse ssh connection though.
Do you mean the Pi connecting to the stationary location instead?

User avatar
default_user8
Posts: 678
Joined: Mon Nov 18, 2013 3:11 am

Re: How to SSH into pi using Tethering from smartphone

Mon Nov 17, 2014 4:10 pm

A mobile hotspot is still a cellular connection, so no port forwarding. You may be able to create a reverse ssh connection over cellular, but i'm not sure. I know that i can connect to my home router via ssh from a mobile connection so a reverse ssh should work. For lack of a better word connecting your pi to a landline network will allow you to port forward and allow you to ssh into your pi.
Two heads are better than one, unless one's a goat head.

Return to “General discussion”