Thanks to ConnectBot, that's not a problem any more.
ConnectBot is a free(!) SSH client for Android that is capable of port-forwarding. Using ConnectBot and adb (from the Android SDK), it's possible to connect your laptop to ports on remote servers.
For example, at the end of this tutorial, you should be able to securely tunnel your web traffic over an SSH tunnel and your Android phone! But don't stop there, if your geek-fu is strong enough, you can connect to any number of services/servers via your phone's 3G connection.
Here's how to set up the SSH tunnel for web browsing:
Need to have:
1 - A laptop with:My setup:
a - SSH client - sudo apt-get install openssh-client
b - Web browser - http://google.com/chrome
c - Android SDK - http://developer.android.com/sdk/index.html
2 - Android-based phone with ConnectBot installed
3 - An SSH server with a public IP address
1 - [Lappy] - Asus EeePC701 w/ Ubuntu 9.04Connections to be made:
2 - Droid [Eris]
3 - [Desky] - VirtualBox on home PC running Ubuntu 9.10
0 - [Lappy]--(usb cable)---[Eris]So what the heck does all that stuff do? Let me explain:
1 - [Lappy]---(./adb forward tcp:10022 tcp:10022)---[Eris]
2 - [Eris]---(ConnectBot port fwd:local, 10022, localhost:22)---[Desky SSH Server]
3 - [Lappy]---(ssh -D 9090 localhost -p 10022)---[Desky SSH Server]
4 - [Browser on Lappy]---(proxy socks, port 9090)---[Desky SSH Server]
0 - Plug your laptop into your phone with the USB cable. On Linux machines, I've found it necessary to start the "HTC Sync" application on the phone. Otherwise the adb application was unable to connect to the phone.
1 - From the command line on the Lappy, you're initiating the adb connection. This will forward ports on your laptop to ports on your phone. In our case, we're forwarding port 10022 on the laptop to port 10022 on the phone.
2 - From ConnectBot on the Eris, we're creating a SSH port-forward from port 10022 on the phone to port 22 on my SSH server. Now, any connections made to port 10022 on the Lappy will be forwarded to the phone which will, in turn, be forwarded to port 22 on the SSH server.
3 - From the command line on the Lappy, open a dynamic port forward on port 9090 on the Lappy to 'localhost' (a.k.a. the Lappy) on port 10022 (which is being forwarded to the SSH server port 22).
4 - In your browser on the Lappy, point it to use a SOCKS proxy of 'localhost' port 9090. Now when you hit "http://google.com" in your browser, it will be sent to port 9090 on your Lappy, which is tunneled over port 10022 on your lappy, which is forwarded to port 10022 on your phone, which is forwarded to port 22 on your SSH server, which is the end point for the dynamic port-forward on port 9090. Got all that? If you're a visual person, try this:
[Lappy Browser]
\
(SOCKS proxy - localhost:9090)
\
(ssh -D 9090 localhost -p 10022)
\
(./adb forward tcp:10022 tcp:10022)
\
[Eris]
\
(ConnectBot port fwd - local, 10022, localhost:22)
\
[SSH Server]
\
plain old internet
If you REALLY want to have some fun, connect your Lappy to your iperf server and you'll be able to check your bandwidth as you go =) I averaged about 200kb/s
1 - [Lappy]---(./adb forward tcp:15001 tcp:15001)---[Eris]
2 - [Eris]---(ConnectBot fwd:local, 15001, iperf_server:5001)---[Desky]
3 - [Lappy] $ iperf -c localhost -P 15001
Have fun and merry Christmas/Happy New Year! =)


