Page 1 of 4 1234 LastLast
Results 1 to 10 of 40
Discuss Port Forward: Having Term-v1100 running in the background while running Safari? at the Tools - Hackint0sh.org; Hello, When I access my work email system in OSX, I run a terminal command ...
  1. #1
    Newbie Array

    Join Date
    Oct 2007
    Posts
    7
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Question Port Forward: Having Term-v1100 running in the background while running Safari?

    Hello,

    When I access my work email system in OSX, I run a terminal command looking like this:
    Code:
    ssh -L 5555:xxx.yyyy.com:5555 -p 2222 CSR+yyyyy@xyz.abc.com
    and then terminal prompts me for my password, I enter it, and I get a confirmation message that I have logged in.
    I then open a browser and access our email client through http://localhost:5555

    I want to do this with my iPhone.
    Using Term-v1100, I have no troubles executing the previously mentioned command, I input my password and voila, I'm in. However, once I go to open Safari, using either Summerboard or the Sunburst Dock app, Term-v1100 resets. It basically closes down, and my connection is dropped.

    I have tried using the nohup command and then my command, but running
    Code:
    nohup ssh -L 5555:xxx.yyyy.com:5555 -p 2222 CSR+yyyyy@xyz.abc.com
    basically nothing happens and I am never prompted for my password.

    The easiest way to get this working, must be to either:
    1. Have Terminal running in the background while I use Safari to browse my email
    2. Find a way to get the system to "remember" the ssh command so it does not "reset" once terminal gets closed down


    Does anybody have any ideas what so ever how this could be done?
    Is there any way to CMD+TAB in iphone?

    Thank you.



  2. #2
    Rookie Array

    Join Date
    Sep 2007
    Posts
    15
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Reading the man pages for ssh it would appear the -f flag would do what you want.

    so something like the following...

    ssh -f -L 5555:xxx.yyyy.com:5555 -p 2222 CSR+yyyyy@xyz.abc.com

    Hope that helps.

  3. #3
    Newbie Array

    Join Date
    Oct 2007
    Posts
    2
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I can confirm that this works.

    I do something similar to access my MythTV system (which is not running SSL due to LBKAC - Lazyness Between Keyboard And Chair).

    If I am at home or on a network I "trust", I just log in. If I do not know who runs the network I use the secure tunnel.

    I wrote a script (sanitized version follows - modify to suit your needs). Put it someplace in your $PATH, and just type the name of the script and your destination IP. re-open the terminal, and kill it when done.

    Code:
    #! /bin/sh
    
    /usr/bin/ssh -p<port> -C -N -f -L 80:localhost:80 <username>@$1
    
    echo "If there are no Errors above this, the Secure Tunnel is Established."
    exit 0
    I used this on my PepperPad, and when I got the iPhone, the script worked un-modified. This is the kind of cool stuff you can do with a hacked iPhone.

    -
    Mobile Linux? Got That.
    PepperPad3, Nokia 770, GP2X, Motorola A780

  4. #4
    Newbie Array

    Join Date
    Oct 2007
    Posts
    7
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Thank you both for your replies, but still, no go.

    Executing the command with -f in it, gives me the following error message:

    "Cannot fork into background without a command to execute."

    Any ideas? I don't get how this cannot be a command to execute, it works fine when I don't have the -f parameter. =/

    Is it because ssh will then prompt me for my password?

    Thank you for your help, much appreciated.

  5. #5
    Advanced Array

    Join Date
    Sep 2007
    Posts
    30
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by floffelos View Post
    Thank you both for your replies, but still, no go.

    Executing the command with -f in it, gives me the following error message:

    "Cannot fork into background without a command to execute."

    Any ideas? I don't get how this cannot be a command to execute, it works fine when I don't have the -f parameter. =/

    Is it because ssh will then prompt me for my password?

    Thank you for your help, much appreciated.
    my one works for ssh tunneling a VNC connection, it is as follows:
    ssh root@XXXX.net -N -L 5900:127.0.0.1:5900 & /Applications/VNsea.app/vnsea


  6. #6
    Newbie Array

    Join Date
    Oct 2007
    Posts
    7
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by CrossBow View Post
    I wrote a script (sanitized version follows - modify to suit your needs). Put it someplace in your $PATH, and just type the name of the script and your destination IP. re-open the terminal, and kill it when done.
    -
    I'm very sorry but this is all kind of new to me, and even though I google, I cannot get a grip of this. I assume I must create a shell script? Apparently I cannot do this on the standard text editor in OSX? Need I to make some chmod -x command in terminal on the iphone once I put the script there?

    If you have the time (and patience), do you think you could make a step by step guide? I have no idea as to what extension I should save this as, nor what my $PATH is.

    Thank you for your help!

  7. #7
    Rookie Array

    Join Date
    Sep 2007
    Posts
    15
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1

    Try adding the -N flag as well...

    ssh -fN -L 5555:xxx.yyyy.com:5555 -p 2222 CSR+yyyyy@xyz.abc.com

  8. #8
    Newbie Array

    Join Date
    Oct 2007
    Posts
    7
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    davepk,

    wow thank you, it worked like a charm. how would I go about making this a shell script so that I don't have to type this in every time I want to port forward?

    also, how can I kill this process once I'm through.

    In case you are curious, I was in fact able to access my email system, log in and everything, but once I open our email tool I get an error message from our internal system:

    Error: no username. Please relogin

    So I assume our system is incompatible with this version of mobile safari, prob something about my "log-in session" with the client not being "remembered" by safari.
    If anybody has some ideas on how to solve this, feel free to share, I'll try to get our support team on this as well, but don't think they are to thrilled about spending time troubleshooting something for the iPhone...

    Either way, THANK YOU for your help guys, I am in debt.

  9. #9
    Professional Array

    Join Date
    Sep 2007
    Posts
    51
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    9

    Default

    Ok, I really need to jack this thread...sorry OP!

    I am trying to use my iPhone to access my campus network. Normally (on a mac laptop), I would enter
    Code:
    ssh [username]@10.0.0.1
    Press enter, then will be prompted to enter my password, after which I am successfully "authenticated" and can utilize the campus network.

    I can get to this step (I know because I get a whole chunk of text confirming success), but I cannot open Safari without closing Terminal - and once this closes I am no longer authenticated and cannot access the network.

    (I am using Term-vt100 if that helps any)

    Entering
    Code:
    ssh -f [username]@10.0.0.1
    gives me an error of "Cannot fork into background without a command to execute" without a password prompt.

    Entering
    Code:
    ssh -fN [username]@10.0.0.1
    prompts me to enter a password, but after sending that nothing happens (no confirmation messages, just goes to a new line starting with a #.) Pressing the home button and opening Safari confirms that I have not authenticated and cannot access the network...

    Please help me out!!

    Thanks in advanced!!!

  10. #10
    Senior Professional Array

    Join Date
    Oct 2007
    Posts
    149
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    14

    Default

    Quote Originally Posted by Unregistered View Post
    Ok, I really need to jack this thread...sorry OP!

    I am trying to use my iPhone to access my campus network. Normally (on a mac laptop), I would enter
    Code:
    ssh [username]@10.0.0.1
    Press enter, then will be prompted to enter my password, after which I am successfully "authenticated" and can utilize the campus network.

    I can get to this step (I know because I get a whole chunk of text confirming success), but I cannot open Safari without closing Terminal - and once this closes I am no longer authenticated and cannot access the network.

    (I am using Term-vt100 if that helps any)

    Entering
    Code:
    ssh -f [username]@10.0.0.1
    gives me an error of "Cannot fork into background without a command to execute" without a password prompt.

    Entering
    Code:
    ssh -fN [username]@10.0.0.1
    prompts me to enter a password, but after sending that nothing happens (no confirmation messages, just goes to a new line starting with a #.) Pressing the home button and opening Safari confirms that I have not authenticated and cannot access the network...

    Please help me out!!

    Thanks in advanced!!!
    I am also having this problem, do you go to the University of Alberta by chance?


 

 
Page 1 of 4 1234 LastLast

Similar Threads

  1. application running in the background
    By poluo in forum iPhone Developer Exchange
    Replies: 3
    Last Post: 05-18-2012, 12:42 PM
  2. Running Apps in the Background
    By iMAChack in forum iOS 4.x (iPhone OS 4.x)
    Replies: 9
    Last Post: 07-23-2011, 11:23 PM
  3. Quit running background apps..
    By Scape-Server in forum iOS 4.x (iPhone OS 4.x)
    Replies: 0
    Last Post: 04-10-2010, 12:10 PM
  4. App Crashes about 6-7 seconds after running in the background
    By xGrill in forum iPhone Developer Exchange
    Replies: 2
    Last Post: 12-07-2008, 08:27 AM
  5. apps running in the background
    By romantiko in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 01-17-2008, 09:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 03:45 AM.
twitter, follow us!