• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[TOOL] SSH Tethering (no root required)

Search This thread

berserker_devel

Inactive Recognized Developer
Jan 20, 2011
367
266
A few days ago I read about the great Koushik Dutta's ClockworkMod Tether and now, with the last release of SSHDroid (1.9.4+ is required), I want to provide you another alternative to CWM that doesn't require root too: SSH Tethering !
As you probably know, we can use (generally speaking) SSH tunneling to provide a SOCKS proxy for ours application (more info here at the "dynamic port forwarding" paragraph) so, if we could use SSHDroid in this way, we would have a ready to use proxy for "tethering" like the CWM's one!

Advantages:
  • Doesn't require a separate tethering plan
  • Not blockable or detectable by carriers
  • Doesn't require root
  • Doesn't require to install additional software on your PC
Requirements:
  • Device drivers installed (99% of you "should" already have that :), this is out of the scope of this thread)
  • SSHDroid or SSHDroidPro (the pro version is not required)
There is no need to write any additional software since we already have all the tools (on all platforms) required to accomplish the job: please note that you don't need to enable USB/WiFi tethering on your device for making this work!

I already packed a ready to use version with all the tools required (Windows only by now), here it is:Steps:
  • Extract one of the above packages
  • Connect your device to the PC with USB
  • Start SSHDroid on your device (the preconfigured packages assume that you haven't changed the default port): please note that you probably need to disable the option "Require WiFi" in this circumstance.
  • Open the package directory on your PC and double click on "run_root.bat" or "run.bat" (depending if SSHDroid is running with root privilegies or not)
  • Wait that the console window disappers and enter the password in putty ('admin' is the default one) once required.
  • Ready! The proxy is active (the shipped version of putty can be iconized in the tray): you only need to configure an app of your choice for using it (if you are using the "SSH Tethering + Preconfigured Firefox" package, Firefox should automatically start and you can already use it!)

An advanced guide (in particular for Linux and Mac users) will come shortly!
 
Last edited:

pwhitersxs

Senior Member
Dec 15, 2008
107
46
I just wanted to say thank you for putting this together. I've tried this on windows vista and it worked great. Very easy. I'm wondering how I can use this to connect winamp for shoutcast streaming.
 

NguyenHuu

Senior Member
Nov 14, 2007
1,737
121
California
Strange, the multiupload links still are bad. It does't load. Can you upload to another file host or directly into xda attachment?
 

NguyenHuu

Senior Member
Nov 14, 2007
1,737
121
California
Thanks! Maybe it is blocked in my country (USA). I downloaded the lite version and will try it.

EDIT: When you have time can you provide instructions to configure firefox so we can use our existing firefox install instead of the portable version? thanks!!
 
Last edited:

berserker_devel

Inactive Recognized Developer
Jan 20, 2011
367
266
Thanks! Maybe it is blocked in my country (USA). I downloaded the lite version and will try it.

EDIT: When you have time can you provide instructions to configure firefox so we can use our existing firefox install instead of the portable version? thanks!!
It's very easy: just set the network configuration with "manual proxy" and socks host = 127.0.0.1, port = 5080.
Here it is what you should get:

firefoxk.png


Hope it helps :)
 

pwhitersxs

Senior Member
Dec 15, 2008
107
46
Also, set your network.proxy.socks_remote_dns to true in firefox. Do this by using about:config.
 

NguyenHuu

Senior Member
Nov 14, 2007
1,737
121
California
Thanks. Do any of you know of an easy way to toggle back and forth between these settings in cases where we are at home for example and have real connection and then when we are on the road we can tether?
 

pwhitersxs

Senior Member
Dec 15, 2008
107
46
An advanced guide (in particular for Linux and Mac users) will come shortly!

Hey man I really appreciate you doing this but I have some questions.

could you use ssh -L 5080:[email protected]:22 [email protected] to set up a http proxy?

I'm trying to tether my unrooted acer tablet to my rooted evo and I'm running into two issues:

1. no loopback device support in my tablet. It's blocked due to no root access I think...I think.
2. no ssh -D support using terminal in lubuntu 12.04. Although I think I can solve this by adding the openssh package.

Again, thanks so much for this.

---------- Post added at 03:18 AM ---------- Previous post was at 03:17 AM ----------

Thanks. Do any of you know of an easy way to toggle back and forth between these settings in cases where we are at home for example and have real connection and then when we are on the road we can tether?


I know in google chrome you can get proxy switchy! or any proxy switch. Then just click it in the upper right corner. I'm sure firefox has the same add on.
 

NguyenHuu

Senior Member
Nov 14, 2007
1,737
121
California
Hey man I really appreciate you doing this but I have some questions.

could you use ssh -L 5080:[email protected]:22 [email protected] to set up a http proxy?

I'm trying to tether my unrooted acer tablet to my rooted evo and I'm running into two issues:

1. no loopback device support in my tablet. It's blocked due to no root access I think...I think.
2. no ssh -D support using terminal in lubuntu 12.04. Although I think I can solve this by adding the openssh package.

Again, thanks so much for this.

---------- Post added at 03:18 AM ---------- Previous post was at 03:17 AM ----------




I know in google chrome you can get proxy switchy! or any proxy switch. Then just click it in the upper right corner. I'm sure firefox has the same add on.

Awesome, will try!
 

pwhitersxs

Senior Member
Dec 15, 2008
107
46
I'm having a hard time getting my evo to ' ssh [email protected]' in lubuntu 12.04. Keep getting permission denied. I tried sudo -i or -s to no avail.

I setup adb and did:

./adb forward tcp: 22 tcp:22
ssh [email protected]

Keep getting permission denied or access denied. Maybe I'll try to setup a key and see if that helps? I'm lost on why it won't connect. Using the package for windows, it works perfectly, just does not want to work in lubuntu.
 
Last edited:

pwhitersxs

Senior Member
Dec 15, 2008
107
46
ok, got it to work. For those who are interested in using this with any variant of ubuntu this is what I did. I'm on lubuntu.

open a terminal:

sudo -i

enter your password

now do a passwd and re-enter your password. the reason I discovered, this is what causes the access denied to localhost. Once I did this step, I no longer got access denied. You may be able to skip this if you have no problem.

now ssh [email protected] to test. enter password and it'll take you to your own computer. this is just to test. If you have a problem, make sure you have openssh and openssh server installed.

---ADB---
follow cyanogenmods guide to install adb. Once downloaded,

cd to directory
./adb*kill-server
sudo ./adb*start-server
./adb*devices

your device should show. If not, check that usb debugging is on. I had an issue with the sdk not downloading properly. Fixed with updating/installing openjdk. else, google it

Now since my ssh droid is on port 24 this is what I did.

./adb forward tcp:24 tcp:24 and forwarded ports

ssh -D 5080 [email protected] -p 24

add proxy anywhere to chrome, add your port which for me is 5080, enjoy.


---CONDENSED LIST OF COMMANDS---

sudo -i
cd /home/user/android-sdk-linux/platform-tools
./adb kill-server
sudo ./adb start-server
./adb devices
./adb forward tcp:24 tcp:24
ssh -D 5080 [email protected] -p 24
 
Last edited:

daniel178

Senior Member
Mar 26, 2011
140
0
Hey,
This seems great and I'd love to use it, but when I try to run "run.bat" it says:
adb server is out of date. killing...
*deamon started successfully*


Then a putty fatal error saying:
server unexpectedly closed network connection

Can I have any help? Running a Win7 machine. Sorry for the newb question...
 

78Staff

Senior Member
Sep 26, 2007
1,526
457
Cosmo, Fl
Was trying to setup and run from linux, however am getting "error: cannot bind to socket" when entering the adb forward command using default port of 22, I assume due to sshd running.

Switching SSHDroidPro over to 24 per pwhitersxs's example, I am able to bind the ports, and able to run the ssh command, which essentially opens an ssh session to the phone. But am unable to browse the internet at this point (chromium proxy setup - socks 127.0.0.1:5080 as per example in thread above).

[21:48 ] > adb forward tcp:24 tcp:24
[21:48 ] > ssh -D 5080 [email protected] -p 24
SSHDroidPro
/storage/extSdCard #

Note I have key for user root so am not manually entering any password...​


EDIT - DOH nevermind... had wrong socks version selected lol. It's always the small things :banghead:

Once I selected SOCKS 5 everything worked like a champ! Well Done! :good:
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    A few days ago I read about the great Koushik Dutta's ClockworkMod Tether and now, with the last release of SSHDroid (1.9.4+ is required), I want to provide you another alternative to CWM that doesn't require root too: SSH Tethering !
    As you probably know, we can use (generally speaking) SSH tunneling to provide a SOCKS proxy for ours application (more info here at the "dynamic port forwarding" paragraph) so, if we could use SSHDroid in this way, we would have a ready to use proxy for "tethering" like the CWM's one!

    Advantages:
    • Doesn't require a separate tethering plan
    • Not blockable or detectable by carriers
    • Doesn't require root
    • Doesn't require to install additional software on your PC
    Requirements:
    • Device drivers installed (99% of you "should" already have that :), this is out of the scope of this thread)
    • SSHDroid or SSHDroidPro (the pro version is not required)
    There is no need to write any additional software since we already have all the tools (on all platforms) required to accomplish the job: please note that you don't need to enable USB/WiFi tethering on your device for making this work!

    I already packed a ready to use version with all the tools required (Windows only by now), here it is:Steps:
    • Extract one of the above packages
    • Connect your device to the PC with USB
    • Start SSHDroid on your device (the preconfigured packages assume that you haven't changed the default port): please note that you probably need to disable the option "Require WiFi" in this circumstance.
    • Open the package directory on your PC and double click on "run_root.bat" or "run.bat" (depending if SSHDroid is running with root privilegies or not)
    • Wait that the console window disappers and enter the password in putty ('admin' is the default one) once required.
    • Ready! The proxy is active (the shipped version of putty can be iconized in the tray): you only need to configure an app of your choice for using it (if you are using the "SSH Tethering + Preconfigured Firefox" package, Firefox should automatically start and you can already use it!)

    An advanced guide (in particular for Linux and Mac users) will come shortly!