How can I connect ADB on remote server through SSH to a local, non-rooted Android devices without installing anything on the middleman with root?
This is what I want to achieve:
┌─────────┐ SSH through internet
│ Physical│ USB cable ┌────────┐ (outside LAN) ┌────────┐
│ Android ├───────────►│ Laptop ├──────────────►│ Cloud │
│ device │ └────────┘ │ server |
└─────────┘ └────────┘
192.168.0.5 192.168.0.7 (internal IP address)
204.12.46.76 108.63.15.64 (public IP address)
The one in the middle must not install any software with root/sudo
. The laptop and server are both running Ubuntu 22.04.
From Android device to laptop, I can use the physical USB cable. From laptop to cloud server, I can use local SSH port forwarding (ADB uses port 5037). However, I do not know how to go from "physical USB cable" to "port 5037".
I include the relevant (fake) internal and external IP addresses for demonstration only.
adb start-server
to make sure adbd is running. Then port forwarding can forward TCP 5037 from Laptop to Cloud so that an adb client on the cloud server can connect to the adb server on the Laptop.Command 'adb' not found, but can be installed with: sudo apt install adb
) and the laptop must not install any software that doesn't exist on a fresh Ubuntu 22.04 install (a non-root install is acceptable).