3 ms·
I just finished a project where this would have been perfect. You can do wireless keyboardless headless setup. You can do it without connecting anything but po
by Nexxxeh 10y ago
I just finished a project where this would have been perfect.
You can do wireless keyboardless headless setup. You can do it without connecting anything but power.
On the SD card, place a file called "ssh" (no extension) so SSH is enabled, and configure wpa_supplicant with your wifi details. I found this on the RPi Stack Exchange [1](thanks scruss)
...On the full up-to-date Raspbian...
>If a wpa_supplicant.conf file is placed into the /boot/ directory, this will be moved to the /etc/wpa_supplicant/ directory the next time the system is booted, overwriting the network settings; this allows a Wifi configuration to be preloaded onto a card from a Windows or other machine that can only see the boot partition.
>Since the /boot partition is accessible by any computer with an SD card reader, wifi configuration is now much simpler.
>A skeleton wpa_supplicant.conf file can be as little as:
network={
ssid="YOUR_SSID"
psk="YOUR_PASSWORD"
key_mgmt=WPA-PSK
}
It needs to be Linux style line endings [according to user2154065] but I used Notepad++ on Windows to do that.
---
[1] http://raspberrypi.stackexchange.com/questions/10251/prepare-sd-card-for-wifi-on-headless-pi http://raspberrypi.stackexchange.com/questions/10251/prepare...
- adammck 10y agoThis is a great feature to get started, but it's unfortunate that the "ssh" file hack doesn't set up SSH keys and disable password auth, or at least change the default password. That must be done manually. I dread to think how many Pis are out there in this configuration. I hope that in future, a proper/official headless image will be provided, to provide more sensible defaults. Until then, I made a little tool to patch the Raspbian images to set things up this way: https://github.com/adammck/headless-raspbian https://github.com/adammck/headless-raspbian
- Nexxxeh 10y agoSorry, I didn't mean to imply that it leaves the pi in a ready-to-deploy stage. I just meant it lets you get into it so you can configure it, which you otherwise need a keyboard or wired NIC for.
- adammck 10y agoNot at all, your solution entirely solves the most annoying part. I just prefer to do the next step in an automated manner, too.
- technomalogical 10y agoCheck out PiBakery, it allows you to take a stock image and do some post-startup config, including setting up keys for SSH and changing passwords. http://www.pibakery.org/ http://www.pibakery.org/
- Havoc 10y ago>the "ssh" file hack doesn't set up SSH keys and disable password auth, or at least change the default password. It's a quick an dirty hack to enable you to SSH on the local network & avoid finding a screen & keyboard. SSH keys you can add later...presumably your local net can keep the bad guys out for the 30 mins it takes.
- Havoc 10y ago>this allows a Wifi configuration to be preloaded onto a card from a Windows or other machine that can only see the boot partition. Awesome thanks