How do I turn off USB tethering or restart USB connection via computer/PC's terminal?
Running the following command as root should enable USB tethering:
service call connectivity 32 i32 1 on Ice Cream Sandwich (4.0) service call connectivity 33 i32 1 on Jelly Bean (4.1 to 4.3) service call connectivity 34 i32 1 on KitKat (4.4) service call connectivity 30 i32 1 on Lollipop (5.0)
See further information in his answer.
Setup ADB in PC, enable USB debugging, launch Terminal/CMD in PC and enter:
adb shell su -c "<cmd>"
<cmd>" with the relevant aforesaid command to enable USB tethering. Change
0 to disable USB tethering.
E.g. For My Jelly Bean 4.2.1, the commands would be:
Enable USB tethering
adb shell su -c "service call connectivity 33 i32 1"
Disable USB tethering
adb shell su -c "service call connectivity 33 i32 0"