So I am experimenting with running a Pi Zero 2w with Alpine Linux as a headless server on my home network and so far I’ve succeeded in flashing the sd card and connecting via ssh via the documentation for setup on raspberry pis and the documentation for headless setup. But after I run “setup-alpine” and reboot I can’t get access via ssh since I get “Permission denied” after entering the password trying to log into root or a user account.
So far I’ve had a look at setting “PermitRootLogin” in /etc/sshd/sshd_config to “yes” and that seems to work, however after a reboot the pi is somehow not visible anymore over the network. I also asked AI and it said that by default Alpine uses dropbear for ssh instead of openssh and the latter could be more strict when it comes to permissions. I’m not so familiar with the workings of ssh so it may just be me doing something wrong or forgetting something during the so I’m asking if anyone here has is familiar with the process or has an idea.
Edit: I solved it by actually setting up the wlan0 interface with the network name and password during the “setup-alpine” this time and now it works. Before I thought that this was not necessary since I was already connected to the Pi via Wifi but apparently during install the wpa_supplicant.conf and the already working interface is not saved and after a reboot the wlan0 interface is therefore not enabled anymore.
For documentation: I set up the sd card with Raspberry Pi Imager selecting Alpine Linux in there. Then I copied the headless apkovl file from the git repo and wpa_supplicant to the root directory of the sd card and booted up the pi. After that I logged into root via ssh and ran “setup-alpine”, configuring the wlan0 interface and using the mmcblk0 disk for a sys installation.
Also not that after the reboot and when using openssh you can’t log in as root with a password since that is not allowed. You have to set up a user account.
Did you commit your changes? IIRC Alpine for Raspi is installed in diskless mode by default and is immutable.
lbu cmmitI solved it now by configuring the wlan0 interface during the setup script and installed using sys mode. But in the future I’ll try diskless mode and then try committing it.
also asked AI and it said that by default Alpine uses dropbear for ssh instead of openssh and the latter could be more strict when it comes to permissions. I’m not so familiar with the workings of ssh
I’d stick to Raspbian if you’re struggling.
I’ve set up a few Pis with raspbian and now I wanted to try something else. It’s more exploration than getting things done.
setup-alpinescript should let you choose between dropbear and opensshThat bit about the pi not being visible in the network after reboot makes me wonder if this is more of a networking issue rather than an ssh one.
The pi zero is WiFi-only, right? Can you confirm that it’s getting on the WiFi network successfully? If so, maybe it’s getting a different IP than it initially did via DHCP.
I solved it now. The problem was that during the setup-alpine script I didn’t set up the wlan0 interface since I thought that it already was set up because I was already connected.
Way to go!
I have never used dropbear but, if it is promoting for a password, doesn’t that mean the system has connected over the network successfully?
Yes absolutely. I must’ve misinterpreted what you said. What did you mean by “not visible anymore over the network.”
I’ve only used dropbear on openwrt systems, but I’m pretty sure it doesn’t use the '/etc/ssh/sshd_config
file. The alpine wiki says the config file is at/etc/conf.d/dropbear`.
Why do you say that it “seems to work”?
If it is no longer visible on the network, are you sure it is still booting successfully?
“Seems to work” means that on the first boot after running setup-alpine and then editing the sshd_config I can then log back in from another terminal using SSH. However after a reboot I can’t connect to the pi again. I’ve also connected it to a display and it looks to be booting like normal.
What are you trying to accomplish with the Pi0-2w? Have you looked into DietPi?
For now I only want to see if I can set up a headless pi with Alpine linux because the distro looks cool. Later maybe I’ll do some project with it and Elixir which I recently got into and are now thinking of things to do with it.


