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.

1 Answer 1


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
adb shell setprop net.dns2
adb shell setprop "net.gprs.http-proxy" ""
adb shell setprop net.usb0.dns1
adb shell setprop net.usb0.dns2

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
ifconfig usb0
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .