I do most of my Cardputer Zero setup over SSH from my desktop. The built-in keyboard is fine for changing a line or two, but for a longer session I prefer a full keyboard and screen. You can also connect a display over HDMI and use a USB keyboard or a compatible Bluetooth keyboard. SSH saves me from moving cables when I’m already sitting at another computer.
Find your Zero on the local network
Connect your computer and the Zero to the same trusted local network. On the Zero, open IP Panel and note the Wi-Fi or Ethernet address you’re using. You’ll also need the Linux username you chose at setup. The M5Stack setup guide shows the SSH option in the first-boot wizard. These steps assume you enabled the SSH server. If you’re already set up, don’t reset or reflash the Zero just to try this.
Connect from your computer
Open PowerShell or Terminal on the computer you’re sitting at. The app named SSH Client on the Zero connects out to another machine. For this guide you’re connecting the other way, into the Zero.
ssh [email protected]
Replace yourname and the example address with your own. At the first connection, compare the host key fingerprint with the one on the Zero before accepting it. If it’s showing an ED25519 key, you can read that fingerprint from a local terminal on the Zero with:
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
If a previously known key changes, stop and check the device and address before accepting a new key. For use at home, there’s no need to forward port 22 on your router.
You don’t need to set up an SSH login key to get started if password sign-in is enabled on the Zero. After verifying the device’s host key, enter the password for your Zero’s Linux account when prompted. It’s normal for nothing to appear as you type. If your Zero is configured for key-only sign-in, use your authorized key instead.
Try one command before changing anything
Run hostname to check that you’re on the Zero. I use JOE, so my next step would be joe ~/ssh-test.txt. That’s a scratch file in your home directory. If you want JOE, the app install guide shows how I added it. Type exit to end the SSH session.
My Zero came with both nano and vi. The vi command opens Vim on my unit. Vim starts in a command mode, so typing doesn’t immediately insert text. If you’re new to modal editors, try nano ~/ssh-test.txt first. In Vim, press i to insert text, then Esc and enter :wq to save and quit.
If it won’t connect
A timeout usually means you should check the address and network first. Guest Wi-Fi may keep devices from talking to each other. For wired Ethernet, check that the USB switch is in Host: the onboard Ethernet uses the internal USB hub and won’t work in Slave mode. A refusal points to the SSH server or a local firewall; a rejected login is a reason to check the username and authentication method.
See the Cardputer Zero hub for more guides and open-source apps.
