Here is how I set up a Raspberry Pi for headless boot and SSH login. It works for devices with built-in WiFi like the Pi3 and Pi Zero W, and for non-wireless Pi models with a Raspbian compatible USB WiFi dongle (like my Pi0
). It's all done prior to the first boot when making the SD card.
- Grab the latest Raspbian image from https://www.raspberrypi.org/downloads/raspbian/
- Grab the Etcher software from https://etcher.io/
- Install Etcher and use it to write the Raspbian image to your SD card. You don't need to extract the image or format the card prior to writing. Just choose the Raspbian Zip, pick your SD card and write (if you have trouble, verify the SHA256 checksum of the download).
- Remove and reinsert the SD card so that your Windows or Mac PC can see the small FAT32 partition on the SD card.
- On that small partition create a file with the name ssh or ssh.txt (it can be empty, the contents don't matter).
- If you are going to connect to a WiFi network, create another file called wpa_supplicant.conf which has the following inside.
Code: Select all
ssid="Your network SSID"
psk="Your WPA/WPA2 security key"
- Edit country=, ssid= and psk= with your information and save the file.
- Safely eject the card from your PC and use it to boot the Pi.
Raspbian will delete the ssh file and enable SSH, and when it finds a wpa_supplicant.conf file, it will move it to its correct location and connect to your wireless network. The first boot can take awhile because Raspbian does some housekeeping and reboots, so give it a minute and then you should be able to SSH into it.
If you are going to be changing passwords from the Pi itself, make sure you get your localisation and keyboard settings configure first, or you may be entering something other than what you think (I strongly suspect this is your problem).
My password is the last 8 digits of Pi.