Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
ConfusedNudeMan
Feb 20, 2004

I'm gay for Frank Dux!
So I've been learning about networking, protocols, etc for a bit now and have been really interested in learning about SSH. Anyway, I was messing around with it on my iPhone and have a few questions. Basically you need a jailbroken iPhone, download OpenSSH from Cydia and then I connected via SSH with PuTTy on my Windows machine. Obviously, when I did this I was on the same network (both phone and PC). So when I entered my internal IP address that my iPhone had, I was able to SSH into my phone no problem. Now, would I be able to SSH into my phone say if I was on a different network? If my phone was at my house with the same internal IP address and I was down the road at a friend's house with a capable machine with an SSH client, could I connect to my phone? How would the client know my phone IP if I am just using the internal IP or would I use an external(?) IP address? Not sure how that works and sorts it self out really. Or would I have to do some more configuring? Also, what kind of things can you do with an SSH connection into your iPhone's file system?

Adbot
ADBOT LOVES YOU

greatant
Oct 17, 2003

The answer is port forwarding.

At your friends house you would ssh into your homes external IP, specifying the port which ssh is running on.

You need to setup port forwarding/NAT on your home router which tells it that when you connect to the routers external IP on a specific port to forward that connection to a specific internal IP and port.

ConfusedNudeMan
Feb 20, 2004

I'm gay for Frank Dux!

greatant posted:

The answer is port forwarding.

At your friends house you would ssh into your homes external IP, specifying the port which ssh is running on.

You need to setup port forwarding/NAT on your home router which tells it that when you connect to the routers external IP on a specific port to forward that connection to a specific internal IP and port.

Bingo. Awesome. I had a suspicion that was it.

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

ConfusedNudeMan posted:

Also, what kind of things can you do with an SSH connection into your iPhone's file system?

This is a pretty open ended question because after you SSH into a jailbroken iPhone you can do anything on the file system you wish.

Some examples that come to mind are putting on custom ringtones, and using SSH as a ghetto form of tethering.

wilfredmerriweathr
Jul 11, 2005
Knowing almost nothing about iOS, I have to ask: could you scp files over to your phone?

nescience
Jan 24, 2011

h'okay

wilfredmerriweathr posted:

Knowing almost nothing about iOS, I have to ask: could you scp files over to your phone?

Should be able to. SCP/SFTP always worked for me without installing anything else but OpenSSH-server. Also wouldn't you already have FTP access if you've jailbroken your iOS?

100 HOGS AGREE
Oct 13, 2007
Grimey Drawer
Make sure you change your root password if you haven't already.

nescience
Jan 24, 2011

h'okay

100 HOGS AGREE posted:

Make sure you change your root password if you haven't already.

haha is it still root/alpine? Haven't used an iOS device since my 4th gen iPod

ConfusedNudeMan
Feb 20, 2004

I'm gay for Frank Dux!

greatant posted:

The answer is port forwarding.

At your friends house you would ssh into your homes external IP, specifying the port which ssh is running on.

You need to setup port forwarding/NAT on your home router which tells it that when you connect to the routers external IP on a specific port to forward that connection to a specific internal IP and port.

Follow up question to this. Say I was running multiple devices/machines on my home network with SSH enabled and I wanted to SSH into one of them from an outside client. Would you configure each device on a different port for SSH? SSH is default port 22. So if my iPhone had SSH and PC had SSH enabled, how would the NAT differentiate each device if you are only specifying a port number through your external IP connection? My guess is using a different port for SSH on each device, but can you do that?

nescience
Jan 24, 2011

h'okay

ConfusedNudeMan posted:

Follow up question to this. Say I was running multiple devices/machines on my home network with SSH enabled and I wanted to SSH into one of them from an outside client. Would you configure each device on a different port for SSH? SSH is default port 22. So if my iPhone had SSH and PC had SSH enabled, how would the NAT differentiate each device if you are only specifying a port number through your external IP connection? My guess is using a different port for SSH on each device, but can you do that?

Yes.

Set your iPhone/PC SSH server port to different numbers, lets say 2222 for your iPhone and 2223 for your pc, and then when you forward your ports, forward 2222 to your iPhone's IP, 2223 to your PC's IP.


e: V that's awesome, didn't know you could do it like that

nescience fucked around with this message at 22:06 on Jun 8, 2014

BurgerQuest
Mar 17, 2009

by Jeffrey of YOSPOS
You shouldn't need to do that. Almost all routers (even lovely Soho ones) will let you specify a unique outside port.

Ie.

123.123.123.123:2222 -> 192.168.1.10:22
123.123.123.123:2223 -> 192.168.1.11:22

Adbot
ADBOT LOVES YOU

SpookyLizard
Feb 17, 2009
Installing openSSH on your jailbroken idevice will enable scp/sftp. The root password is still alpine, and yes, you should change it posthaste.

Most common uses for it include backing up settings files, or editing some setting configure files, especially LockBackground.html, or transferring over icon files. There's a couple of good icon packs/themes out there that don't make it to a main repo or even a less popular one. Or AppYouNeed.ipa doesn't have an icon in the theme you really like, so you make one and put it on yourself.

These are all things that can pretty much be done on your phone in iFile, but maybe you don't like touchscreen file browsing and want a commander style layout or whatever.

  • Locked thread