Skip to content

Instantly share code, notes, and snippets.

@k-bharadwaj
Created February 13, 2026 02:31
Show Gist options
  • Select an option

  • Save k-bharadwaj/37b1a39d6ddbcabca97e1a4258b54d9e to your computer and use it in GitHub Desktop.

Select an option

Save k-bharadwaj/37b1a39d6ddbcabca97e1a4258b54d9e to your computer and use it in GitHub Desktop.
USB ssh into a raspberry pi running Ubuntu
  • Edit /boot/firmware/config.txt and add dtoverlay=dwc2 at the bottom

  • Edit /boot/firmware/cmdline.txt and add modules-load=dwc2,g_ether after rootwait (or at the end if there’s no rootwait)

  • Add the following to /etc/netplan/50-cloud-init.yaml

network:
    ethernets:
        usb0:
            dhcp4: false
            link-local: [ ipv4 ]
            optional: true
  • Shutdown, remove power pins if connected, turn the pi on with usb-c, verify being able to ssh in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment