This script will make some small but necessary changes to a default Raspberry Pi OS (previously called Raspbian) image.
In episode hpr2356 :: Safely enabling ssh in the default Raspbian Image I walked through the first steps of automating the update of this base image. It will:
- Download the latest image zip file
- Verify it is valid
- Extract the image itself
- Enable ssh for secure remote management
- Change the default passwords for the root and pi user
- Secure the ssh server on the Pi
Since then I improved the script to:
- Enable connections to your WiFi network (default_wifi.nmconnection)
- Load it's configuration from a ini file keeping sensitive information separate from the main script.
- Using losetup to greatly simplify the mounting of the image.
- Creation of a First Boot script.
- Moved creation of the passwords and accounts to the ini file
- Added support to select which Raspberry_Pi_OS Version to download
- Added support set up default users using userconf.txt
This script is part of a series "Manage your Raspberry Pi fleet with Ansible" which was covered on opensource.com and on Hacker Public Radio.