Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I need a solution that will work without jailbreaking.

On Linux and on OSX, I use ssh on the command-line to open ssh tunnels so I can run client-server applications securely.

I need to do the equivalent on ios (run some kind of tunnel in the background, while I run a client application through that tunnel).

share|improve this question

3 Answers 3

up vote 4 down vote accepted

iSSH supports opening tunnels. For example, I can set a tunnel on local port 4444 that points to an IP address and port 80. Opening localhost:4444 in Safari then loads that website through the tunnel. iSSH also has good support for saved configurations and public key authentication.

Under the App Store rules, iSSH is only allowed to keep the connection open for up to 10 minutes in the background, so after 9 minutes or so I'll get a notification and the tunnel will be closed if I don't switch back to iSSH quickly enough.

share|improve this answer
    
ty for the detailed answer! Maybe it'll take strong competition from other OSes to drive Apple to lift these types of silly restrictions in the future... –  kfmfe04 Oct 21 '12 at 23:59
1  
I doubt you'll see this restriction go away any time soon. The biggest reason for its existence is battery life. Minimal background tasks means users can safely go about their business without worrying about other apps draining their battery. On a device that effectively has only one program running at a time, it makes a fair bit of sense really. The catch is that it's optimizing the behaviour for the users, not making developer's lives easier. –  robmathers Oct 22 '12 at 0:27

This isn't possible under the current iOS App Store rules (and this is unlikely to change in the foreseeable future). Apps are very limited in what they can do in the background, and keeping the sort of persistent connection that an SSH tunnel requires wouldn't be permitted.

Some apps (such as VNC clients) have built-in SSH tunnelling capability to get around this, but if the apps you're using don't include it, the only option (short of jailbreaking) is to use the built-in iOS VPN capability. It doesn't support SSH, but it does support L2TP/IPSec, PPTP, and some other variants.

share|improve this answer
    
Forgot to mention, I am not looking to sell my app for the public (on the App Store) - this is an in-house app for personal use. If it really turns out that this isn't possible under ios, I will prolly switch to Android (pretty sure it's possible there, but I will have to confirm) - I tend to be platform agnostic... –  kfmfe04 Oct 21 '12 at 22:52
1  
Well, even though your app may not be subject to the App Store rules, any third party app from the store will be. Which means unless you jailbreak, you can't do this using a third party app. You could of course use an SSH library in your app to include SSH functionality directly, but how do to that is a programming question, more appropriate for StackOverflow. –  robmathers Oct 21 '12 at 22:58
    
+1 for that alternative (ty - I will consider it before moving to Android)... ...I'm beginning to see why some developers don't like developing in this kind of environment. Also thanks for the VPN hint - setting up a VPN server on Linux may be less work than trying to get a ssh tunnel in ios. –  kfmfe04 Oct 21 '12 at 23:10

vSSH supports tunneling. You can setup tunneling in the "Port forwarding" section of the connection settings. Local, remote and dynamic (SOCKS proxy) forwarding are supported.

You are able to use tunneling even without opening SSH session (shell permissions are not necessary for ssh user in this case).

Due to iOS limitation the app can work in background only for 10 minutes (iOS 5,6) or 3 minutes (iOS 7). vSSH reminds you about this timeout through Notifications.

share|improve this answer
    
Welcome to Ask Different! Please read the help center regarding self-promotion and include a disclaimer if you are the author of the product in your answer. –  grgarside Apr 24 at 14:46

Your Answer

 
discard

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.