suspacket
Posts: 1
Joined: Wed Jun 07, 2023 2:21 pm

SSH over USB in Debian 12 Bookworm

Wed Jun 07, 2023 3:09 pm

I am trying to run debian 12 image (BookWorm) on a pi zero W with ssh enable over usb but it does not seem to be working at all
I downloaded the image from https://raspi.debian.net/tested/2022012 ... orm.img.xz
then used etcher.io to create a bootable sd card with two partitions RASPFIRM and RASPROOT, next i modified the cmdline.txt in RASPFIRM to look like this

Code: Select all

console=tty0 console=ttyS1,115200 root=LABEL=RASPIROOT rw fsck.repair=yes net.ifnames=0 cma=64M rootwait modules-load=dwc2,g_ether  g_ether.dev_addr=0a:73:42:ce:7d:0f  g_ether.host_addr=0a:73:42:ce:7d:ff

next i edit config.txt to look like so

Code: Select all

enable_uart=1
upstream_kernel=1

kernel=vmlinuz-5.15.0-2-rpi
# For details on the initramfs directive, see
# https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=10532
initramfs initrd.img-5.15.0-2-rpi
dtoverlay=dwc2

saved both files and booted the pi, when i do ifconfig on my machine i get usb0 interface with a mac address different than the one i used in cmdline.txt

but when i check /var/log/messages, /var/log/kern.log, /var/log/syslog all of them show the following messages

Code: Select all

Jan 14 13:37:16 rpi kernel: [   18.424219] usb0: HOST MAC 0a:73:42:ce:7d:ff
Jan 14 13:37:16 rpi kernel: [   18.471062] usb0: MAC 0a:73:42:ce:7d:0f
can anyone explain why isn't the mac address of the usb0 on the host machine changed

User avatar
thagrol
Posts: 9866
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: SSH over USB in Debian 12 Bookworm

Wed Jun 07, 2023 8:09 pm

suspacket wrote:
Wed Jun 07, 2023 3:09 pm
saved both files and booted the pi, when i do ifconfig on my machine i get usb0 interface with a mac address different than the one i used in cmdline.txt

but when i check /var/log/messages, /var/log/kern.log, /var/log/syslog all of them show the following messages

Code: Select all

Jan 14 13:37:16 rpi kernel: [   18.424219] usb0: HOST MAC 0a:73:42:ce:7d:ff
Jan 14 13:37:16 rpi kernel: [   18.471062] usb0: MAC 0a:73:42:ce:7d:0f
can anyone explain why isn't the mac address of the usb0 on the host machine changed
I've not used plain Debian (bookworm or otherwise) only RPiOS which is based on Debian. And only up to Bullseye.

The MAC addresses look correct. They match the ones specified in your config.txt.

HOST MAC is the MAC address presented to the USB host/master. MAC is the address presented to Linux on the Pi end of the link. g_ether (and the configfs equivalent) works by presenting as two USB ethernet adapters - one to the OS on the Pi (the device end) and one to the OS on the USB host/master (the HOST end). Normal network interface rules apply - they must be different and have different IP addresses asigned to them.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

User avatar
kerry_s
Posts: 6030
Joined: Thu Jan 30, 2020 7:14 pm

Re: SSH over USB in Debian 12 Bookworm

Thu Jun 08, 2023 1:26 am

did you read the top of the file you edited, it says use /etc/default/raspi-something

also like sudo, ssh may not be installed by default.

it's been awhile since i last used, but they were changing the base to only have enough to boot and the user was expected to install as needed.

so try ' which ssh '

User avatar
kerry_s
Posts: 6030
Joined: Thu Jan 30, 2020 7:14 pm

Re: SSH over USB in Debian 12 Bookworm

Thu Jun 08, 2023 2:16 am

also using raspberry os lite 64bit and changing the sources lists to bookworm is a much simpler install.
much better base setup to start with.

Return to “Debian”