SSH via USB-C in RPI4

Hi all, I’m not sure if this is the right place to ask but is there a way for me to ssh via USB in my RPI4? I have setup a headless system on my RPI4 and wanted to be able to connect to it without needing an Ethernet cable.

I was able to get this working previously on an RPI Zero with Raspbian. I can’t seem to find any relevant information for doing this with Arch Linux ARM. If this is possible, I would appreciate some help on setting it up :smiley:

Thanks!

How? 

1 Like

Does this help?

1 Like

This is what I did for my RPI0 before. But from the guide, cmdline.txt in my RPI4 is missing, so I guess that only works for Raspbian?

It depends on what software is used to connect the computer to network using USB.

As long as you have the Raspberry Pi USB-C port connected to the Raspberry Pi power supply, it would be difficult to do.

However, I have heard of people connecting the RPi 4 USB-C port to the USB-C port of another computer, say a desktop. Then the RPi 4 USB-C port would function for both data and power from the “Mother” computer. I assume they are using SSH to communicate, but I have not tried this. The “Mother” computer would have to be powered up to use the RPi 4. Plus you would be able to communicate only with the “Mother” computer.

I have also heard of people using the RPi 4 built in WiFi for communication with other computers on the network that have WiFI. Again, I am assuming they are using SSH, and again I have not tried this.

If you want to try either of the above suggestions, duckduckgo would be your friend.

HTH

Pudge

1 Like

Hey there. I know this topic was about a month ago but I’ve been so busy with uni stuff and didn’t get to play with my RPI4 again until just recently so I apologize if everyone in this thread got notified :sweat_smile:

Yes, that’s exactly what I meant to do. My RPi4 is headless so I thought it would be convenient to just connect it to my laptop running EOS :heart: than get a dedicated monitor and keyboard for it.

I saw several articles including from MagPi how to do this but I am not sure if the same options work since they used Raspbian so I would like some help on “translating” and correcting the actions I did:

Add dtoverlay=dwc2 to the /boot/config.txt.
Add modules-load=dwc2 to the end of /boot/cmdline.txt

I’m assuming they require dcw2 module for the RPi4 to be setup in “gadget mode” so I did a sudo modprobe dwc2 and got no error. So I think I’m okay on that part if I just add load the module on boot?

Add libcomposite to /etc/modules

Just did another modprobe and got no error so I’m doing the same thing as above.

Add denyinterfaces usb0 to /etc/dhcpcd.conf

I installed dhcpcd and enabled the systemd service then added that line.

Create /etc/dnsmasq.d/usb with following content:
interface=usb0
dhcp-range=10.55.0.2,10.55.0.6,255.255.255.248,1h
dhcp-option=3
leasefile-ro

Just did as it told. I didn’t have a dnsmasq.d folder initially though so I created one.

Create /etc/network/interfaces.d/usb0 with the following content:
auto usb0
allow-hotplug usb0
iface usb0 inet static
address 10.55.0.1
netmask 255.255.255.248

I’m currently stuck there because I don’t have a /etc/network/ folder and I don’t know the relevant config file for it. /etc/netctl/interfaces (?)

TIA for any help anyone can give me :smiley:

Btw, here’s the post I’m following.

This link does not work.

Pudge

Oops. My bad. Fixed it now