USB gadget mode in Raspberry Pi OS: SSH over USB - Raspberry Pi Blog

TL;DR

Have you ever found yourself in a hotel room with no Ethernet ports or dealing with a Wi-Fi network that refuses to cooperate? If you're a software developer working with Raspberry Pi or other single-board computers, you understand the frustration of getting your device connected while on the go. Fortunately, a new feature in Raspberry Pi OS—USB gadget mode—streamlines the process of establishing a direct connection between your Raspberry Pi and laptop, allowing for seamless SSH access over USB. This means no more tedious Wi-Fi setups or IP address hunting; just plug in and get to work.