From 21d3dbbf28c199e26bd4074e63bc5966aae3f363 Mon Sep 17 00:00:00 2001 From: c0de Date: Thu, 4 Jan 2024 14:02:10 -0600 Subject: [PATCH] add info for fixing ssh server on first boot to readme --- readme.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 4b540b8..9e78518 100644 --- a/readme.md +++ b/readme.md @@ -7,6 +7,8 @@ Some ansible playbooks to manage a [pibox](https://pibox.io) in various ways 1. Internet connection 1. Python 3 on Linux (or WSL) 1. One or more PiBoxes that you don't want to manage through [KubeSail](https://kubesail.com) + - I recommend [installing the latest version](https://docs.kubesail.com/guides/pibox/rpiboot/) before proceeding + - _Note: There is a bug where the ssh server won't start. Fix outlined below._ ## Getting Started @@ -16,5 +18,26 @@ Some ansible playbooks to manage a [pibox](https://pibox.io) in various ways 1. Enter the virtual environment: `source .venv/bin/activate` 1. (optional) Upgrade PIP: `pip3 install --upgrade pip` 1. Install ansible: `pip3 install -r requirements.txt` -1. Configure Inventory, host vars and group vars - 1. You probably don't have my domain name on your network lol +1. Configure [inventory](./ansible/inventories/inventory.yml) + - You probably don't have my domain name on your network lol +1. Ping your hosts: `ansible -i ansible/inventories/inventory.yml all -m ping` + - If you can't resolve any hosts, check DNS. It's always DNS. +1. Proceed to running playbooks + +## Fixing no SSH on latest version + +During install of the custom image, `pi flasher` allowed me to configure things like the hostname, ssid, my ssh key, my user account. This sets up a script that runs when the pi reboots for the first time after install. + +1. Mount the pi's `/boot` volume (it should be in your file manager somewhere) +1. Edit the `initial-boot.sh` (or similar named script) +1. Add `ssh-keygen -A` somewhere in the file +1. Save and close the file +1. Safely unmount the pi's `/boot` +1. Done! The ssh server is now functional + +_Alternatively, you can wait for the system to boot with a keyboard and monitor connected and:_ + +- _login;_ +- _open a terminal;_ +- _run `sudo ssh-keygen -A`;_ +- _then `sudo systemctl enable --now ssh`._