Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I have a linux box, without any network interface, only usb. I have my andorid phone, and the USB cable. I would like to connect from my android device to the linux box,and execute shell commands on the linux box, via usb. there is not wifi, ethernet, oer any other interfaces.

Any idea? I tried ConnectBot, but could not make it work over USB.

share|improve this question
add comment

1 Answer

Reverse USB Tethering

adb shell netcfg usb0 up
adb shell netcfg usb0 dhcp
adb shell route add default gw X.X.X.X dev usb0
adb shell setprop ro.kernel.android.ndns 2
adb shell setprop net.dns1 4.2.2.2
adb shell setprop net.dns2 8.8.8.8
adb shell setprop "net.gprs.http-proxy" ""
adb shell setprop net.usb0.dns1 4.2.2.2
adb shell setprop net.usb0.dns2 8.8.8.8

Do not copy and paste these commands. Read them and see if you can understand what they are accomplishing and modify them to suit your needs. You are routing over USB.

ifconfig eth0 0.0.0.0
ifconfig usb0 0.0.0.0
brctl addbr br0 
brctl addif br0 eth0
brctl addif br0 usb0
ifconfig br0 up
dhclient br0

Do not copy and paste these commands. Since you don't have network access on your PC, you will not need to make a bridge, but if you ever add a NIC, then you may want to create a bridge.

share|improve this answer
add comment

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.