<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5187850748460065119</id><updated>2012-01-29T03:19:23.226+04:00</updated><category term='tether iphone ssh tunnel USB Cable'/><category term='ssh iphone reverse tunnel USB Cable'/><category term='tether iphone ssh tunnel OpenVPN USB Cable'/><title type='text'>alk blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://alk2blog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://alk2blog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>alk</name><uri>http://www.blogger.com/profile/08913769599258264868</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://images.kovalevich.multiply.com/logo/3'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5187850748460065119.post-1419787448288411698</id><published>2008-10-07T18:24:00.019+04:00</published><updated>2008-10-08T23:19:03.441+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tether iphone ssh tunnel OpenVPN USB Cable'/><title type='text'>SSH to tether your iphone with OpenVPN over USB cable</title><content type='html'>&lt;span style="font-style: italic;"&gt;With appearance of  &lt;/span&gt;&lt;a href="http://junefabrics.com/iphone/index.php" style="font-style: italic;"&gt;PdaNet for iphone&lt;/a&gt;&lt;span style="font-style: italic;"&gt; the connection of your PC to the Internet through the iphone (tethering) turns into a trivial task. You only need  to arrange ad-hoc wifi connection between your PC and iphone and forget about all socks, proxy, tunnels etc. PdaNet turns your iphone into a wireless router giving you FULL Internet access on the computer for all protocols/ports/services you need.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;In this post I'll try to show how to reach the same functionality connecting your PC to the iphone over cable with the help of &lt;a href="http://en.wikipedia.org/wiki/Openvpn"&gt;OpenVPN&lt;/a&gt;. Why OpenVPN? Because it is the only vpn suite which can use TCP protocol and one port for connection. That's why we can arrange ssh local tunnel to link the PC with external vpn server over iphone's GPRS/EDGE/3G.&lt;br /&gt;OpenVPN is a great cross-platform freeware and open source program for creating virtual private network (VPN) between computers. I found some original guides in linux guru blogs (&lt;a href="http://blog.daeland.com/category/iphone/"&gt;here&lt;/a&gt; and &lt;a href="http://habrahabr.ru/blogs/iphone/41472/"&gt;here&lt;/a&gt;) so my idea is only to repeat the same tricks for Windows.&lt;br /&gt;We need two PCs, one is a laptop to be tethered where we'll install openvpn client. Another machine is home or small-office PC connected to broadband Internet line and to be configured as openvpn server.&lt;br /&gt;The main idea of VPN is gaining secure access to the intranet shared resources, company internal web-site or mailserver over fast Internet line through encrypted tunnel between client and server hosts. In addition, vpn-server can be a kind of "router" for the remote vpn-client giving full Internet access to it. Typically it's not needed because vpn-client is already in the Internet and gains only access to the private resources at the server's LAN. But in our case it is essential, the laptop will be connected to the vpn server over GPRS/EDGE/3G and get full Internet access from it. All requests will be wrapped into openvpn tunnel which in turn will be wrapped into ssh tunnel between ssh-client, the laptop, and ssh-server, the iphone. Sounds complicated? Let's see.&lt;br /&gt;First, we need to install and configure our openvpn hosts. The latest release version of openvpn is 2.09, you can download it from official page at &lt;a href="http://www.openvpn.net/index.php/downloads.html"&gt;http://www.openvpn.net/index.php/downloads.html&lt;/a&gt;, there is GUI interface for Windows at &lt;a href="http://openvpn.se/"&gt;http://openvpn.se&lt;/a&gt;. Besides, the new openvpn version 2.1 (pre-release is available) supports Vista and contains GUI already inside. I experimented with this pre-release version on my Vista Home Premium laptop connecting  it to my office openvpn 2.09 server without problem.&lt;br /&gt;The installation is rather easy, one extra tun/tap pseudo network adapter is added to each system. This adapter will be used for point-to-point connection, it is fully controlled by openvpn so don't touch it at all.&lt;br /&gt;Assume we have openvpn server with fictitious address remote.vpn.com somewhere in Internet. This server has two real Ethernet adapters. One is for external connection, another is part of small-office LAN within 172.29.10.x range, this LAN adapter address is 172.29.10.10, the third "adapter" is openvpn MyTap. So server's Network Places look like this (ignore Incoming connections here):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_xNZo9zeJbQU/SOu3niHPuSI/AAAAAAAAACk/j_KCslCpwBs/s1600-h/network.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5254495280057792802" alt="" src="http://3.bp.blogspot.com/_xNZo9zeJbQU/SOu3niHPuSI/AAAAAAAAACk/j_KCslCpwBs/s400/network.png" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" /&gt;&lt;/a&gt;In order to provide the Internet access for MyTap adapter, i.e. for vpn-client, we will enable Internet Connection Sharing on External Connection for MyTap adapter&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_xNZo9zeJbQU/SOu6H9URsbI/AAAAAAAAACs/rh5S8PaDxDY/s1600-h/ics2tap.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5254498036139274674" alt="" src="http://2.bp.blogspot.com/_xNZo9zeJbQU/SOu6H9URsbI/AAAAAAAAACs/rh5S8PaDxDY/s400/ics2tap.png" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" /&gt;&lt;/a&gt;and disable the Windows Firewall on MyTap adapter&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_xNZo9zeJbQU/SOu6Xtd014I/AAAAAAAAAC0/h1Pj6yYjtvQ/s1600-h/Nofw_tap.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5254498306762266498" alt="" src="http://4.bp.blogspot.com/_xNZo9zeJbQU/SOu6Xtd014I/AAAAAAAAAC0/h1Pj6yYjtvQ/s400/Nofw_tap.png" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" /&gt;&lt;/a&gt;We need to prepare and tune up ovpn configuration file, one on laptop, another on server, samples are stored in sample-config subdirectory. So just copy client.ovpn from sample-config to config subdirectory on laptop, do the same for server.ovpn on your server. Note that openvpn is rather sensitive for config files changes so please modify them if you know what you do.&lt;br /&gt;For both config.ovpn and client.ovpn it is essential to have:&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;# Are we connecting to a TCP or&lt;br /&gt;# UDP server?  Use the same setting as&lt;br /&gt;# on the server.&lt;br /&gt;proto tcp&lt;br /&gt;;proto udp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:Courier New;font-size:100%;"  &gt;# "dev tun" will create a routed IP tunnel,&lt;br /&gt;# "dev tap" will create an ethernet tunnel.&lt;br /&gt;# Use "dev tap0" if you are ethernet bridging&lt;br /&gt;# and have precreated a tap0 virtual interface&lt;br /&gt;# and bridged it with your ethernet interface.&lt;br /&gt;# If you want to control access policies&lt;br /&gt;# over the VPN, you must create firewall&lt;br /&gt;# rules for the the TUN/TAP interface.&lt;br /&gt;# On non-Windows systems, you can give&lt;br /&gt;# an explicit unit number, such as tun0.&lt;br /&gt;# On Windows, use "dev-node" for this.&lt;br /&gt;# On most systems, the VPN will not function&lt;br /&gt;# unless you partially or fully disable&lt;br /&gt;# the firewall for the TUN/TAP interface.&lt;br /&gt;dev tap&lt;br /&gt;;dev tun&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For client.ovpn we use 127.0.0.1 for ssh tunnel connection, not real server address here.&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;# The hostname/IP and port of the server.&lt;br /&gt;# You can have multiple remote entries&lt;br /&gt;# to load balance between the servers.&lt;br /&gt;remote 127.0.0.1 1194&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For server.ovpn we need to append (highlighted in blue) the following section:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;# If enabled, this directive will configure&lt;br /&gt;# all clients to redirect their default&lt;br /&gt;# network gateway through the VPN, causing&lt;br /&gt;# all IP traffic such as web browsing and&lt;br /&gt;# and DNS lookups to go through the VPN&lt;br /&gt;# (The OpenVPN server machine may need to NAT&lt;br /&gt;# the TUN/TAP interface to the internet in&lt;br /&gt;# order for this to work properly).&lt;br /&gt;# CAVEAT: May break client's network config if&lt;br /&gt;# client's local DHCP server packets get routed&lt;br /&gt;# through the tunnel.  Solution: make sure&lt;br /&gt;# client's local DHCP server is reachable via&lt;br /&gt;# a more specific route than the default route&lt;br /&gt;# of 0.0.0.0/0.0.0.0.&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;push "redirect-gateway def1"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and these&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;# Configure server mode and supply a VPN subnet&lt;br /&gt;# for OpenVPN to draw client addresses from.&lt;br /&gt;# The server will take 10.8.0.1 for itself,&lt;br /&gt;# the rest will be made available to clients.&lt;br /&gt;# Each client will be able to reach the server&lt;br /&gt;# on 10.8.0.1. Comment this line out if you are&lt;br /&gt;# ethernet bridging. See the man page for more info.&lt;br /&gt;;server 10.8.0.0 255.255.255.0&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;server 192.168.0.0 255.255.255.0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;# Certain Windows-specific network settings&lt;br /&gt;# can be pushed to clients, such as DNS&lt;br /&gt;# or WINS server addresses.  CAVEAT:&lt;br /&gt;# &lt;a target="_blank" href="http://openvpn.net/faq.html#dhcpcaveats"&gt;http://openvpn.net/faq.html#dhcpcaveats&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;push "dhcp-option DNS 192.168.0.1"&lt;br /&gt;push "dhcp-option WINS 192.168.0.1"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;At this point we consider openvpn configuration finished. I intentionally skip the important part of secure keys generating. It is described in details in hundreds of online openvpn manuals and guides. Remember, you must generate client keys on server console and then transfer them to client for further use.&lt;br /&gt;&lt;br /&gt;Let's return to our ssh-client on laptop and configure Tunnelier (which we so successfully used &lt;a href="http://alk2blog.blogspot.com/2008/08/ssh-to-tether-your-iphone-over-usb.html"&gt;before&lt;/a&gt;) to arrange the only one C2S tunnel. Please disable any other options which we used before for socks-proxy and mail tunnels (see my older posts). Now we have only this entry in C2S Forwarding screen:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_xNZo9zeJbQU/SOvJKOjKdTI/AAAAAAAAAC8/ZWzC03_1T38/s1600-h/C2S_openvpn.PNG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5254514567799272754" alt="" src="http://4.bp.blogspot.com/_xNZo9zeJbQU/SOvJKOjKdTI/AAAAAAAAAC8/ZWzC03_1T38/s400/C2S_openvpn.PNG" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" /&gt;&lt;/a&gt;where remote.vpn.com is our openvpn server address in the Internet and 1194 is port OpenVPN uses.&lt;br /&gt;We connect the iphone to the laptop with USB cable, check ssh is ON in iphone's Bossprefs, change auto-lock to Never and start Runtunnel.cmd on laptop to enable itunnel (see my older posts). Make sure the GPRS/EDGE/3G is available on the iphone and press Login in Tunnelier.&lt;br /&gt;If ssh connection is OK you can start openvpn client connection. Use OpenvpnGUI icon in tray to start openvpn session. If it's successful the laptop's tap-adapter will get 192.168.0.2 from openvpn server which according to ICS main rule keeps 192.168.0.1 for itself.&lt;br /&gt;The server provides full NAT (network address translation) for client's requests wrapped into openvpn tunnel. Then the client gains FULL Internet access directly,  now without any changes in its browser/mailer/im configuration. You can easily start, for instance, ftp-session or mail client or RDP in your notebook without any extra preparations. Moreover, after openvpn you can even start PPTP/L2TP/IPSec vpn connection with some third-party vpn-server which was not possible before because of ssh limitation to serve TCP protocol only.&lt;br /&gt;As a result, we have encrypted and compressed openvpn tunnel between laptop and soho server on TCP port 1194 and get FULL Internet access for laptop over GPRS/EDGE/3G provided by iphone!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5187850748460065119-1419787448288411698?l=alk2blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alk2blog.blogspot.com/feeds/1419787448288411698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5187850748460065119&amp;postID=1419787448288411698' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default/1419787448288411698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default/1419787448288411698'/><link rel='alternate' type='text/html' href='http://alk2blog.blogspot.com/2008/10/ssh-to-tether-your-iphone-over-usb.html' title='SSH to tether your iphone with OpenVPN over USB cable'/><author><name>alk</name><uri>http://www.blogger.com/profile/08913769599258264868</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://images.kovalevich.multiply.com/logo/3'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_xNZo9zeJbQU/SOu3niHPuSI/AAAAAAAAACk/j_KCslCpwBs/s72-c/network.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5187850748460065119.post-5560318243563698822</id><published>2008-08-09T10:08:00.029+04:00</published><updated>2010-06-15T11:56:25.964+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh iphone reverse tunnel USB Cable'/><title type='text'>SSH to get your iphone online via USB cable</title><content type='html'>&lt;span style="font-style: italic;"&gt;This manual is based on the ideas and guides first presented &lt;/span&gt;&lt;a style="font-style: italic;" href="http://ironphone.ru/faq/510/"&gt;here&lt;/a&gt;&lt;span style="font-style: italic;"&gt; in Russian and agreed with the author.&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://alk2blog.blogspot.com/2008/08/ssh-to-tether-your-iphone-over-usb.html"&gt;previous manual&lt;/a&gt; I have described how to connect your PC to GPRS/EDGE Internet provided by iphone via USB cable. This outstanding result achieved with the help of small utility called &lt;span style="font-weight: bold;"&gt;iTunnel.exe&lt;/span&gt; from Iphone Tunnel Suite released recently. SSH protocol is used to provide the connection between the PC and the iphone.&lt;br /&gt;&lt;br /&gt;Now I will try to explain another way of communication the iphone can use. We will connect it to the Internet-connected PC via standard USB cable and get the iphone online in this passthru, reverse mode. Without wifi, without GPRS/EDGE fee to GSM operator. Incredible, impossible? Read further...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;The PC:&lt;/span&gt;&lt;br /&gt;iTunes should be installed on the PC (&lt;span style="font-weight:bold;"&gt;UPDATE: iTunes 8.2/9 should be used for iphone OS3.x&lt;/span&gt;), moreover you may need &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;amp;displaylang=en"&gt;.NET Framework 3.5&lt;/a&gt; to be installed in order to make it work. By the way, I managed to start it on Vista Home Premium SP1 with its native .NET Framework 3.0. Iphone Tunnel Suite is not needed. Instead you need to download only a core part, the iTunnel.exe, one supplementary dll (iTunesMobileDevice.dll) and startup cmd-file. The link to itunnel.zip is below:&lt;br /&gt;&lt;a href="http://www.mediafire.com/?tnaqjzw0mnd"&gt;http://www.mediafire.com/?tnaqjzw0mnd&lt;/a&gt; - for OS2.x&lt;br /&gt;&lt;a href="http://www.mediafire.com/?tlmdkorzmyq"&gt;http://www.mediafire.com/?tlmdkorzmyq&lt;/a&gt; - &lt;span style="font-weight:bold;"&gt;for OS3.x&lt;/span&gt; (iTunesMobileDevice.dll from iTunes 8.2)&lt;br /&gt;&lt;a href="http://www.mediafire.com/?2q1fzowoy12"&gt;http://www.mediafire.com/?2q1fzowoy12&lt;/a&gt; - &lt;span style="font-weight:bold;"&gt;for iTunes 9&lt;/span&gt; (iTunesMobileDevice.dll from iTunes 9)&lt;br /&gt;&lt;br /&gt;For ssh access I am going to use Bitvise Tunnelier but you can try any ssh client you like. In particular, &lt;a href="http://tp.vbap.com.au/"&gt;Tunnelier Portable&lt;/a&gt; is excellent GUI ssh client with clear interface and good help file. It doesn't need to be installed on the computer and can be started even from USB flash drive. Download it from here:&lt;br /&gt;&lt;a href="http://tp.vbap.com.au/download"&gt;http://tp.vbap.com.au/download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;The iphone:&lt;/span&gt;&lt;br /&gt;You must have OpenSSH installed on the iphone. I recommend to have Bossprefs as a toggle tool in order to enable SSH server and for some other tricks below. Disable &lt;span style="font-weight: bold;"&gt;wifi&lt;/span&gt; to avoid any interference.&lt;br /&gt;Make sure your gprs/edge settings (APN etc.) are entered in the iphone and it reliably works over gprs/edge. We need it only to be sure that gprs/edge network interface is OK.&lt;br /&gt;&lt;br /&gt;1-4. The first three steps are the same as in &lt;a href="http://alk2blog.blogspot.com/2008/08/ssh-to-tether-your-iphone-over-usb.html"&gt;previous post&lt;/a&gt;. Extract TunnelierPortable and itunnel.zip if didn't do it before, locate Runtunnel.cmd and be ready to start later. Start TunnelierPortable.exe, if you save your profile before, the program will autoload it after start. Check settings according to the following screens, some of them need to be changed.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xNZo9zeJbQU/SJ1ChbHdQzI/AAAAAAAAABE/VfNwY8s8EeU/s1600-h/login.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_xNZo9zeJbQU/SJ1ChbHdQzI/AAAAAAAAABE/VfNwY8s8EeU/s400/login.png" alt="" id="BLOGGER_PHOTO_ID_5232411484056535858" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Login&lt;/span&gt; - enter 127.0.0.1 into the Host field, the Username is root, the initial method is "password". The password is alpine (if you didn't change it). You can store the encrypted password in the profile if you like.&lt;br /&gt;For better security you can use key pairs for authentication but this item is out of current guide, see ssh manual for details or wait for my further posts on it.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xNZo9zeJbQU/SJ1ECIwEM8I/AAAAAAAAABM/LA_0gHe1Pf8/s1600-h/options.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_xNZo9zeJbQU/SJ1ECIwEM8I/AAAAAAAAABM/LA_0gHe1Pf8/s400/options.png" alt="" id="BLOGGER_PHOTO_ID_5232413145573897154" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Options &lt;/span&gt;- notice two check boxes at the top right corner. Enabling "Open Terminal" and "Open SFTP" you can use internal Tunnelier Terminal and SFTP client (WinSCP-like) to access the iphone after the connection.&lt;br /&gt;I recommend you to enable them both now, you may need them later.&lt;br /&gt;&lt;div style="text-align: center;"&gt;* * *&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Services&lt;/span&gt; - in previous post it was important option to enable socks-proxy on the PC. Now we don't need this option. Please &lt;span style="font-weight: bold;"&gt;uncheck &lt;/span&gt; SOCKS/HTTP Proxy  Forwarding on the Services screen if it was Enabled before.&lt;br /&gt;&lt;div style="text-align: center;"&gt;* * *&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Client to Server Forwarding&lt;/span&gt; - if you have any entries here (left from previous exercise) disable or delete them on this screen. Later you can save settings in a new profile making previous profile intact and keeping all your socks and C2S entries.&lt;br /&gt;&lt;br /&gt;And finally:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xNZo9zeJbQU/SJ1LkMefmKI/AAAAAAAAABk/0jiVhOKGrIA/s1600-h/S2C_fwd.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_xNZo9zeJbQU/SJ1LkMefmKI/AAAAAAAAABk/0jiVhOKGrIA/s400/S2C_fwd.png" alt="" id="BLOGGER_PHOTO_ID_5232421427270883490" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Server to Client Forwarding&lt;/span&gt; - the most important new screen in this guide. It contains entries for so called reverse port forwarding (-R in OpenSSH)  through the ssh tunnel. This is the most incredible point in the huge list of ssh protocol capabilities.  Let me explain it briefly. In prevoius guide and in this one the PC is ssh client while the iphone is ssh server. After the connection between them ssh allows not only reach some external sites through the forwarded ports from client to server but in the reverse direction, from server to client too. It means that if our PC acting as ssh client is connected to the external network (via Ethernet or wireless connection) the ssh server will be able to reach client's network too. Unfortunately, this can not be made directly, for any of this connection we should provide the "reverse tunnel" between client and server.&lt;br /&gt;OK, what should be done for iphone?&lt;br /&gt;We need http proxy for all http-based native iphone applications. If you don't have proxy server in your LAN you need to install some personal and easy to configure proxy server on your PC. I recommend privoxy (www.privoxy.org), it is free open-source proxy server well-known with its good ad-blocking filters. Installation is straight-forward, privoxy is ready to use immediately after setup is finished.&lt;br /&gt;Start it, you will notice blue circle with P in your tray. Double click on it will open main privoxy window. Optionally you can make privoxy to be more informative. To change its config choose Options/Edit main configuration, privoxy will open it config.txt, find section 3.1 debug and uncheck this part in it:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;debug      1 # log each request destination (and the crunch reason if Privoxy intercepted the request)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;debug   4096 # Startup banner and warnings&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;&lt;br /&gt;debug   8192 # Non-fatal errors&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;Save config.txt, privoxy will accept changes immediately. It will give you more information in Privoxy window when connection will be made. The default http port it uses to serve client's requests is &lt;span style="font-weight: bold;"&gt;8118&lt;/span&gt;.&lt;br /&gt;Let's return to S2C Forwarding screen, you may notice that its first entry prepares the tunnel to provide the requests from the iphone to the PC over port 8118. Then we have another issue.&lt;br /&gt;How to force the iphone to use http proxy on its primary, gprs/edge interface?&lt;br /&gt;There is no menu in iphone settings to change it (unlike the wifi), it is not documented but it is possible.&lt;br /&gt;The trick is to change the iphone's preferences  file in the following location.&lt;br /&gt;/private/var/root/Library/Preferences/SystemConfiguration/preferences.plist (for 1.1.1 firmware)&lt;br /&gt;or&lt;br /&gt;/private/var/preferences/SystemConfiguration/preferences.plist (for 1.1.3 or higher)&lt;br /&gt;The recommended way is to copy this file from iphone to your PC using sftp-interface of Tunnelier (see later), modify it with some text editor, for instance Wordpad, save, check the name of the modified file doesn't contain .txt ending and copy it back to the iphone.&lt;br /&gt;What should be modified in preferences.plist? You need to add section responsible for using proxy autoconfiguration file there. Locate the part shown below and append it with a text in blue color:&lt;br /&gt;&lt;br /&gt;&amp;lt;dict&amp;gt;&lt;br /&gt;&amp;lt;key&amp;gt;Interface&amp;lt;/key&amp;gt;&lt;br /&gt;&amp;lt;dict&amp;gt;&lt;br /&gt;&amp;lt;key&amp;gt;DeviceName&amp;lt;/key&amp;gt;&lt;br /&gt;&amp;lt;string&amp;gt;ip1&amp;lt;/string&amp;gt;&lt;br /&gt;&amp;lt;key&amp;gt;Hardware&amp;lt;/key&amp;gt;&lt;br /&gt;&amp;lt;string&amp;gt;com.apple.CommCenter&amp;lt;/string&amp;gt;&lt;br /&gt;&amp;lt;key&amp;gt;Type&amp;lt;/key&amp;gt;&lt;br /&gt;&amp;lt;string&amp;gt;com.apple.CommCenter&amp;lt;/string&amp;gt;&lt;br /&gt;&amp;lt;key&amp;gt;UserDefinedName&amp;lt;/key&amp;gt;&lt;br /&gt;&amp;lt;string&amp;gt;com.apple.CommCenter (ip1)&amp;lt;/string&amp;gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;/span&gt;&amp;lt;/dict&amp;gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;key&amp;gt;Proxies&amp;lt;/key&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;key&amp;gt;ProxyAutoConfigEnable&amp;lt;/key&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;integer&amp;gt;1&amp;lt;/integer&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;key&amp;gt;ProxyAutoConfigURLString&amp;lt;/key&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;string&amp;gt;file:///private/var/preferences/proxy.pac&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;&lt;br /&gt;...some more entries which we don't touch&lt;br /&gt;&lt;br /&gt;In this file we add the link to proxy autoconfiguration file proxy.pac in /private/var/preferences directory on iphone. The file contains proper address for the proxy server.&lt;br /&gt;When the iphone is connected to the PC via USB cable proxy.pac must be:&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;function FindProxyForURL(url, host)&lt;br /&gt;{&lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;return "PROXY 127.0.0.1:8118";&lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you need to get access to gprs/edge outdoors proxy.pac must be just:&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;function FindProxyForURL(url, host)&lt;br /&gt;{&lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;return "DIRECT";&lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;Update: Starting from fw 2.2 you don't need to switch back to "DIRECT" in proxy.pac. I noticed that Safari and other http-based iphone applications start working over GRPS/EDGE again if there is no cable connection despite the proxy.pac remains with PROXY 127.0.0.1 inside. So the rest of section 1-4 (EdgeProxy plugin etc.) could be easily skipped to section 5 and kept here for historical reasons only. Anyway, if you prefer to switch proxy mode on and off you, sure, can use the method described below.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To simlify the task I have already prepared these files for you. Download edgeproxy.zip from here&lt;br /&gt;&lt;a href="http://www.mediafire.com/?ymkdc9zmjjh"&gt;http://www.mediafire.com/?ymkdc9zmjjh&lt;/a&gt;&lt;br /&gt;In addition, I have made the plugin for BossPrefs 1.73 allowing to toggle proxy.pac thru BossPrefs interface.&lt;br /&gt;Please find detailed manual in the Readme.txt inside.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xNZo9zeJbQU/SJ1fnOdG6_I/AAAAAAAAAB0/xcK5FyAzWh0/s1600-h/IMG_9002.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_xNZo9zeJbQU/SJ1fnOdG6_I/AAAAAAAAAB0/xcK5FyAzWh0/s400/IMG_9002.JPG" alt="" id="BLOGGER_PHOTO_ID_5232443469574106098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Note the archive doesn't contain proxy.pac directly, but only two pattern files: proxy.edge and proxy.off.&lt;br /&gt;Enabling EdgeProxy ON should copy &lt;span&gt;proxy.edge&lt;/span&gt; to &lt;span style="font-weight: bold;"&gt;proxy.pac&lt;/span&gt;, create signal .pid file and &lt;span style="font-weight: bold;"&gt;REBOOT&lt;/span&gt; the iphone in few seconds to enable proxy settings. After restart BossPrefs will show you the right status of the EdgeProxy. So now the iphone is ready for connection via USB.&lt;br /&gt;When you need to disable proxy start BossPrefs again and flick the EdgeProxy OFF. BossPrefs will copy proxy.off to &lt;span style="font-weight: bold;"&gt;proxy.pac&lt;/span&gt;, remove .pid file and &lt;span style="font-weight: bold;"&gt;REBOOT&lt;/span&gt; the iphone to make changes.&lt;br /&gt;On my 1.1.1 firmware everything is working fine. I am not sure it will be so easy on more newer versions because of changes (user mobile) in BossPrefs execution of plugin commands.&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;Update: Everything is OK here with 2.0.2 iphone and latest Bossprefs. So please use the plugin.&lt;/span&gt;&lt;br /&gt;Anyway, you know that through the Tunnelier Terminal connection (started with root credentials) you can make some copy commands manually or just prepare simple .sh scripts to automate the task.&lt;br /&gt;See my scripts &lt;a href="http://www.mediafire.com/?mcwlbwlmt1z"&gt;here&lt;/a&gt; as an example of those scripts.&lt;br /&gt;OK. Now everything is ready to start.&lt;br /&gt;&lt;br /&gt;5. Connect the iphone to the PC with standard USB cable, be sure that SSH server is enabled on the iphone. Be sure your PC is connected to the Internet.&lt;br /&gt;6. Launch the &lt;span style="font-weight: bold;"&gt;Runtunnel.cmd&lt;/span&gt; mentioned above. If you didn't start it before notice Windows Firewall warning and add iTunnel to the exceptions list. You will see the black console window contains nothing except the itunnel.exe 22 22 command. Do NOT close this window, it should stay opened during the whole connection session, later you will notice some messages there proving that tunnel is working.&lt;br /&gt;7. Press Login button in Tunnelier. First time the client will ask you to accept the host key from ssh server (your iphone). Accept it and look at the Tunnelier lower pane for log of the connection. If you enable Terminal and SFTP check-boxes Terminal and SFTP client windows will be opened.&lt;br /&gt;You can use SFTP to copy  &lt;span style="font-weight: bold;"&gt;preferences.plist&lt;/span&gt; forth and back to arange proxy access if you didn't do it before. You can use Tunnelier Terminal to execute commands to replace proxy.pac if BossPrefs failed to do it.&lt;br /&gt;If everything is fine with preferences.plist and proxy.pac after the ssh connection you can start Safari on your iphone. Safari should start working over proxy server on our PC, you can see some entries in privoxy main window if you enable extra debugging options in privoxy config above. It means that our goal is reached! Open &lt;a href="http://2ip.ru/"&gt;http://2ip.ru&lt;/a&gt; or &lt;a href="http://www.whatismyip.com"&gt;http://www.whatismyip.com&lt;/a&gt; in Safari to make sure that your ip address is the same as on your Internet-connected PC. Try other iphone applications - Weather, Stocks, Maps, YouTube, iTunes, Cydia. Anything that use http to access  will be forwarded thru reverse tunnel from ssh-server to ssh-client and appears as local proxy request to the privoxy proxy server. Fine. Our wildest dreams come true!&lt;br /&gt;&lt;br /&gt;In addition, if you have some other proxy server in your LAN, for instance, in your office you can connect the iphone to it directly. In this case you don't need privoxy. Assuming this proxy server address is 192.168.0.10 and port 3128 we can change our S2C settings as shown below.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xNZo9zeJbQU/SJ1opT0vLhI/AAAAAAAAAB8/PYkJ_XYDVFg/s1600-h/S2C_fwdX.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_xNZo9zeJbQU/SJ1opT0vLhI/AAAAAAAAAB8/PYkJ_XYDVFg/s400/S2C_fwdX.png" alt="" id="BLOGGER_PHOTO_ID_5232453400979779090" border="0" /&gt;&lt;/a&gt;Now we put 192.168.0.10 in Destination host field and 3128 in Destionation Port. All requests from the iphone to LAN proxy server will look like the requests from your PC so you don't need  extra permissions.&lt;br /&gt;&lt;br /&gt;Well, but what about Mail? It doesn't use http for access. Look at the S2C Forwarding screen again, two additional entries are two additional reverse tunnels to provide access to gmail imap and smtp servers. If you use another mail providers please change the Destination host and port accordingly. The only drawback is that you need to change Mail settings in the iphone menu, so instead of real mail server name or ip address you should enter 127.0.0.1. In my gmail example it should look like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xNZo9zeJbQU/SJ1fWcchrYI/AAAAAAAAABs/q23e5V-05oc/s1600-h/IMG_9001.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_xNZo9zeJbQU/SJ1fWcchrYI/AAAAAAAAABs/q23e5V-05oc/s400/IMG_9001.JPG" alt="" id="BLOGGER_PHOTO_ID_5232443181271985538" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Please note&lt;/span&gt; that if you do not change settings for email accounts Mail will still be working over gprs/edge wasting operator's traffic despite the iphone is connected to the PC via USB cable.&lt;br /&gt;If you use some other native iphone applications that should be connected over their own ports please add extra entries in S2C Forwarding screen with Destination Host and Port used by these applications. In configuration of the application don't forget to choose 127.0.0.1 as its server address in order to tunnel the connection from telephone to computer via USB cable. Remember, ssh can tunnel TCP-based connections only.&lt;br /&gt;OK, the long guide is finished, it was longer than I thought before start. I hope you  managed to fulfill the mission. If not please check back all settings, screenshots and  files. Don't be hurry. Try again and you will get it as I am.&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;If you have question, remarks or additions feel free to apply it to me by &lt;a href="mailto://alk@inbox.ru"&gt;email&lt;/a&gt;.  I will try to help.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5187850748460065119-5560318243563698822?l=alk2blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alk2blog.blogspot.com/feeds/5560318243563698822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5187850748460065119&amp;postID=5560318243563698822' title='150 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default/5560318243563698822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default/5560318243563698822'/><link rel='alternate' type='text/html' href='http://alk2blog.blogspot.com/2008/08/ssh-to-get-your-iphone-online-via-usb.html' title='SSH to get your iphone online via USB cable'/><author><name>alk</name><uri>http://www.blogger.com/profile/08913769599258264868</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://images.kovalevich.multiply.com/logo/3'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_xNZo9zeJbQU/SJ1ChbHdQzI/AAAAAAAAABE/VfNwY8s8EeU/s72-c/login.png' height='72' width='72'/><thr:total>150</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5187850748460065119.post-1275068654077053965</id><published>2008-08-06T08:29:00.020+04:00</published><updated>2009-09-17T18:41:21.680+04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tether iphone ssh tunnel USB Cable'/><title type='text'>SSH to tether your iphone over USB cable to get your PC online</title><content type='html'>&lt;span style="font-style: italic;"&gt;This manual is based on the ideas and guides first presented &lt;/span&gt;&lt;a style="font-style: italic;" href="http://ironphone.ru/faq/452/"&gt;here&lt;/a&gt;&lt;span style="font-style: italic;"&gt; in Russian and agreed with the author.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The goal is to connect your Windows PC to the Internet over iphone's GPRS/EDGE via USB cable.&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;The PC:&lt;/span&gt;&lt;br /&gt;iTunes should be installed on the PC (&lt;span style="font-weight:bold;"&gt;UPDATE: iTunes 8.2/9 should be used for iphone OS3.x&lt;/span&gt;), moreover you may need &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;amp;displaylang=en"&gt;.NET Framework 3.5&lt;/a&gt; to be installed in order to make it work. Iphone Tunnel Suite is not needed. Instead you need to download only a core part, the iTunnel.exe, one supplementary dll (iTunesMobileDevice.dll) and startup cmd-file. The link to itunnel.zip is below:&lt;br /&gt;&lt;a href="http://www.mediafire.com/?tnaqjzw0mnd"&gt;http://www.mediafire.com/?tnaqjzw0mnd&lt;/a&gt; - for OS2.x&lt;br /&gt;&lt;a href="http://www.mediafire.com/?tlmdkorzmyq"&gt;http://www.mediafire.com/?tlmdkorzmyq&lt;/a&gt;&lt;span style="font-weight:bold;"&gt;  - for OS3.x&lt;/span&gt; (iTunesMobileDevice.dll from iTunes 8.2)&lt;br /&gt;&lt;a href="http://www.mediafire.com/?2q1fzowoy12"&gt;http://www.mediafire.com/?2q1fzowoy12&lt;/a&gt; - &lt;span style="font-weight:bold;"&gt;for iTunes 9&lt;/span&gt; (iTunesMobileDevice.dll from iTunes 9)&lt;br /&gt;&lt;br /&gt;For ssh access I am going to use Bitvise Tunnelier. In particular, &lt;a href="http://tp.vbap.com.au/"&gt;Tunnelier Portable&lt;/a&gt; is excellent GUI ssh client with clear interface and good help file. It doesn't need to be installed on the computer and can be started even from USB flash drive. Download it from here:&lt;br /&gt;&lt;a href="http://tp.vbap.com.au/download"&gt;http://tp.vbap.com.au/download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;The iphone:&lt;/span&gt;&lt;br /&gt;You need to have OpenSSH installed and optionally some of the "toggle" application like Bossprefs, Netservices or Services in order to enable/disable SSH server. Disable &lt;span style="font-weight: bold;"&gt;wifi&lt;/span&gt; to avoid any interference.&lt;br /&gt;&lt;br /&gt;1. Start TunnelierPortablev1.1.4.26.paf.exe and extract its content to some directory, for instance, C:\PortableApps\TunnelierPortable&lt;br /&gt;2. Extract itunnel.zip to the same directory.&lt;br /&gt;3. Find Runtunnel.cmd file here and be prepared to start it later. This batch file has only one command inside&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;itunnel.exe 22 22 &lt;/span&gt;&lt;br /&gt;which will do the trick. This console application builds a "port bridge" between the iphone port 22 and the same port on the PC.&lt;br /&gt;4. Start &lt;span style="font-weight: bold;"&gt;TunnelierPortable.exe&lt;/span&gt; and tune it up according to the following screenshots.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xNZo9zeJbQU/SJoNBRxJXoI/AAAAAAAAAAM/KHseXYkDWQs/s1600-h/login.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_xNZo9zeJbQU/SJoNBRxJXoI/AAAAAAAAAAM/KHseXYkDWQs/s400/login.png" alt="" id="BLOGGER_PHOTO_ID_5231508232744820354" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Login&lt;/span&gt; - enter 127.0.0.1 into the Host field, root as login, choose for initial method "password" and enter the root's password below. You can store the encrypted password in the profile if you like.&lt;br /&gt;For better security you can use key pairs for authentication but this item is out of our guide, see ssh manual for details.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xNZo9zeJbQU/SJoQCBoeMnI/AAAAAAAAAAc/wkuCZi1bGuI/s1600-h/options.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_xNZo9zeJbQU/SJoQCBoeMnI/AAAAAAAAAAc/wkuCZi1bGuI/s400/options.png" alt="" id="BLOGGER_PHOTO_ID_5231511544128221810" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Options &lt;/span&gt;- notice two check boxes at the top right part. Enabling "Open Terminal" and "Open SFTP" you can use internal Tunnelier Terminal and SFTP client (WinSCP-like) to access the iphone after the connection.&lt;br /&gt;Disable any of them if you don't need them opened.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xNZo9zeJbQU/SJoRKVJAzHI/AAAAAAAAAAk/h4Z7vf6mBec/s1600-h/services.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_xNZo9zeJbQU/SJoRKVJAzHI/AAAAAAAAAAk/h4Z7vf6mBec/s400/services.png" alt="" id="BLOGGER_PHOTO_ID_5231512786315562098" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Services&lt;/span&gt; - an excellent feature of Tunnelier to arrange local socks-proxy server on the PC  (the same as -D key in OpenSSH) to provide access for any socks-aware client applications on your PC.&lt;br /&gt;Notice the port is &lt;span style="font-weight: bold;"&gt;1080&lt;/span&gt;, you can change it here but don't forget to change it in your client socks configuration later.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xNZo9zeJbQU/SJoTzLMyDaI/AAAAAAAAAA0/0pi_NjZrtGE/s1600-h/C2S_fwd.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_xNZo9zeJbQU/SJoTzLMyDaI/AAAAAAAAAA0/0pi_NjZrtGE/s400/C2S_fwd.png" alt="" id="BLOGGER_PHOTO_ID_5231515687044910498" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Client to Server Forwarding&lt;/span&gt; - this screen is optional and contains three sample entries to show how to make local port (-L in OpenSSH) tunneling for non socks-aware applications. For example, Gmail imap/smtp access for Outlook Express is shown. Additionally, Remote Desktop connection to some fictitious remote.pc.com site is displayed, note the local port number is chosen not to be the same as local listening RDP port if it's enabled on your PC.&lt;br /&gt;OK, now Tunnelier  is prepared for connection, you can save the profile for future use if you like.&lt;br /&gt;5. Connect the iphone to the PC with standard USB cable, be sure that SSH server is enabled on the iphone.&lt;br /&gt;6. Launch the &lt;span style="font-weight: bold;"&gt;Runtunnel.cmd&lt;/span&gt; mentioned in point 3. Notice Windows Firewall warning and add iTunnel to the exceptions list. You will see the black console window contains nothing except the above command. Do NOT close this window, it should stay opened during the whole connection session, later you will notice some messages there proving that tunnel is working.&lt;br /&gt;7. Press Login button in Tunnelier. First time the client will ask you to accept the host key from ssh server (your iphone). Accept it and look at the Tunnelier lower pane for log of the connection.  If you enable Terminal and SFTP check-boxes Terminal and SFTP client windows will be opened allowing you to interact with iphone.&lt;br /&gt;The connection is made. Now you need only to tune up your Windows applications to get access to the Internet over ssh tunnel.&lt;br /&gt;Mozilla Firefox/Thunderbird should be set to use localhost socks5 proxy server according to the following screen:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xNZo9zeJbQU/SJoZJMMrBnI/AAAAAAAAAA8/5hfiGEuUW0I/s1600-h/ff_socks.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_xNZo9zeJbQU/SJoZJMMrBnI/AAAAAAAAAA8/5hfiGEuUW0I/s400/ff_socks.png" alt="" id="BLOGGER_PHOTO_ID_5231521562828146290" border="0" /&gt;&lt;/a&gt;If you have some more socks-aware applications tune them accordingly.&lt;br /&gt;In addition, you need to change some advanced settings in Mozilla applications for proper DNS resolution.&lt;br /&gt;Open &lt;span style="font-family:courier new;"&gt;about:config&lt;/span&gt; in Firefox (type this in the address in new tab) to start Advanced configuration and find the following string&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;network.proxy.socks_remote_dns&lt;/span&gt; and double click on it to change its value to &lt;span style="font-weight: bold;"&gt;true&lt;/span&gt;&lt;br /&gt;The same trick should be made in Thunderbird, to access Advanced Configuration choose Tools/Options/Advanced/General and click on Config Editor...&lt;br /&gt;Unfortunately, the iphone DNS resolver works rather strange and buggy, so you may experience some troubles with opening of popular web-sites like yahoo.com or google.com - in order to force the iphone resolver I recommend you to open them in the iphone's Safari before. Immediately after opening in the iphone this site will be available in Firefox too. Some IM applications may be configured to use ip-address instead of server's name to connect.&lt;br /&gt;Alright, we've got the PC connected to the iphone via USB cable,  packets are transfered over the ssh tunnel between the computer and the iphone. The iphone is connected to the Internet over GPRS/EDGE/3G so we have it on the PC for socks-configured clients. You can open some diagnostic sites like &lt;a href="http://2ip.ru/"&gt;2ip.ru&lt;/a&gt; to be sure that your ip-address is from the pool of your iphone GSM operator.&lt;br /&gt;How to get access for any other applications (remember, ssh works only with TCP).&lt;br /&gt;For instance, Outlook Express can not use socks, so we arrange two extra tunnels for it (see C2S Fwd screen). The only thing we need is to guide OE to connect not to the original smtp/imap servers but to localhost (127.0.0.1) on the same port as the Gmail servers use. To simplify the task and keep the OE servers settings untouched you can modify Windows hosts file adding the strings like this into it:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;127.0.0.1  imap.gmail.com&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;127.0.0.1  smtp.gmail.com&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/span&gt;Finally, to access Remote Desktop of our sample remote.pc.com site over EDGE you need to start Remote Desktop Connection on your PC and enter the following address in the Computer field:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;127.0.0.1:33890&lt;/span&gt;&lt;br /&gt;In this case your PC will be connected to the remote site in Internet over the third sample tunnel.&lt;br /&gt;Voila! The small iTunnel.exe application (don't forget to look at its black window) helps us to tether with iphone and connect the PC to the Internet world. And we managed to do it without wifi!!&lt;br /&gt;&lt;br /&gt;In the next post I will explain how to succeed in the opposite case - to connect the iphone via the USB cable to your Internet-connected PC in passthru mode. Be patient and stay tuned...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5187850748460065119-1275068654077053965?l=alk2blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default/1275068654077053965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default/1275068654077053965'/><link rel='alternate' type='text/html' href='http://alk2blog.blogspot.com/2008/08/ssh-to-tether-your-iphone-over-usb.html' title='SSH to tether your iphone over USB cable to get your PC online'/><author><name>alk</name><uri>http://www.blogger.com/profile/08913769599258264868</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://images.kovalevich.multiply.com/logo/3'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_xNZo9zeJbQU/SJoNBRxJXoI/AAAAAAAAAAM/KHseXYkDWQs/s72-c/login.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-5187850748460065119.post-2931067278091551196</id><published>2007-03-09T14:27:00.000+03:00</published><updated>2007-08-20T16:42:12.211+04:00</updated><title type='text'>Multiply.com favorite pages</title><content type='html'>&lt;a href="http://chocolito.multiply.com/music"&gt;http://chocolito.multiply.com/music&lt;/a&gt;&lt;br /&gt;&lt;a href="http://grise.multiply.com/music"&gt;http://grise.multiply.com/music&lt;/a&gt;&lt;br /&gt;&lt;a href="http://prestigio.multiply.com/music"&gt;http://prestigio.multiply.com/music&lt;/a&gt;&lt;br /&gt;&lt;a href="http://arc2home.multiply.com/music"&gt;http://arc2home.multiply.com/music&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5187850748460065119-2931067278091551196?l=alk2blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alk2blog.blogspot.com/feeds/2931067278091551196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5187850748460065119&amp;postID=2931067278091551196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default/2931067278091551196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5187850748460065119/posts/default/2931067278091551196'/><link rel='alternate' type='text/html' href='http://alk2blog.blogspot.com/2007/03/multiplycom-favorite-pages.html' title='Multiply.com favorite pages'/><author><name>alk</name><uri>http://www.blogger.com/profile/08913769599258264868</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://images.kovalevich.multiply.com/logo/3'/></author><thr:total>0</thr:total></entry></feed>
