Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to see if I can SSH to my iPhone using the 3G network. So, given my IP, I am trying to make contact through SSH, using the defined port (which is no longer 22, I changed it).

It all works fine on my private wifi network. For some reason, it doesn't on 3G...

Any ideas ?


share|improve this question

migrated from May 2 '12 at 13:51

This question came from our site for computer enthusiasts and power users.

3G services are often on private addressed networks, and use NAT to get out to the internet. What IP is your phone getting on 3G (and I mean the phone itself, not what you see on – Paul May 2 '12 at 12:30
It's possible on remote, normal networks, but I've never tried/heard of being able to access servers that are hosted over cellular data. – Andrew Larsson May 2 '12 at 23:02
If a NAT is used (and it surely is used - I can get only 3 different IP addresses by reconnecting), then how are ports managed? Skype uses port 80, email is used for email ports, and all online games - need a port to function ? – Ted May 3 '12 at 12:10

a) Unless you have jailbroken your device, iOS doesn't have an SSH server to run.

b) If you have jailbroken your device, it will not be possible to SSH into your iPhone over cellular. You are behind one of the most complex NAT setups there is. When you move between towers, and lose signal, you lose your lease to a unique ID with the cellular network (like an IP). However, every time your connection is re-established with your carrier, you're connected to a new tower and your connection is routed differently through another NAT and finally out somewhere, probably in another state.

In researching this alone, over the course of 10 minutes, my iPhone returned 2 different IPs from the internet, one in Florida, one in Pennsylvania.

Short answer: Wi-Fi = yes | Cellular = no

share|improve this answer
Doesn't DNS solve this? Perhaps there is a way to give your phone a DNS. The IP address could change, per tower for instance, but the DNS to which you connect with SSH would remain the same. I wonder if this is possible. – Adriaan Feb 13 '15 at 8:51
And as the answer from mspasov indicates, the address might also not change if you have a VPN tunnel running. SSH over VPN perhaps? – Adriaan Feb 13 '15 at 8:52

Yes, you can, if you use a VPN service, that assigns you a real, unmasked IP address (which will be accessible from the internet) or a VPN to your local network.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.