The Pi NFS root¶
You operate the welland fleet and want to know which accounts and keys every netbooted board has, where they come from, and why changing one reboots the fleet.
Every netbooted board shares one root, so every board has the same accounts, keys and host key.
Account |
uid:gid |
sudo |
Password |
|
|---|---|---|---|---|
|
1000:1000 |
NOPASSWD ( |
from |
server-user key, controller key, operators’ GitHub keys, jump account key, static keys |
|
0:0 |
server-user key, controller key, operators’ GitHub keys |
||
|
1001:1001 |
NOPASSWD ( |
locked |
the controller key only ( |
The CI image build creates
piandansible(fixpi/tasks/netboot.yml,fixpi_image_build).ansible’s uid and gid are pinned byfixpi_ansible_uidso every image agrees.The
pipassword.pi_pw(vaulted in host_vars) is the plaintext shared password.fixpi/tasks/userconf.ymlwrites its sha512-crypt hash into the root’s/etc/shadow, on the gateway only: never in the CI image (fixpi_image_build).roles/sitepasses it, base64-encoded, to Django asPI_PW. The board page’s web terminal (wssh) and the upload page log in topi@10.21.S.Pwith it.fixpi/files/etc/ssh/sshd_config.d/password.confkeepsPasswordAuthentication yeson the Pis for that reason. This is intentional; it is only tweed that is key-only.The ssh login banner. The board pages say “password is in login banner”, so the boards’ sshd shows one before the password prompt (#215):
fixpi/tasks/userconf.ymlwrites/etc/ssh/sshd_bannerin the root fromfixpi/templates/etc/ssh/sshd_banner.j2, with the linesuser: piandpassword: <pi_pw>, and the drop-insshd_config.d/banner.confsetsBannerto it. Like the password itself it is written on the gateway only, never in the CI image. The console banner (/etc/issue.d) is a separate file in getty’s own format and does not carry the password.The keys (
fixpi_authorized_keys_files, built byfixpi/tasks/authorized_keys.yml):Source
What
Variable
server
tweed’s
/home/admin/.ssh/id_rsa.pubfixpi_server_user_pubkeycontroller
the
fpgas.online-ansiblepublic keyansible_ssh_private_key_file+.pub(group_vars/all/controller.yml)github
https://github.com/<user>.keysfor thegh:ids inoperators_accounts(mithro, CarlFK), each line taggedgh:<user>fixpi_github_key_users,fixpi_github_keys_base_urljump
tweed’s
/home/pi/.ssh/id_ed25519.pub,pionlyfixpi_jump_ssh_pubkeystatic
full public key lines kept in the inventory (the label station’s),
pionly unless a file’skey_sourceslistsstaticfixpi_static_public_keysThe root gets exactly the keys GitHub lists at the time of the converge. The download runs first in site.yml’s “Update the Pi NFS root” play, before the update lock and the image extraction, so a failed download stops the run before the root is touched.
Host key. Every board presents the same ED25519 host key,
SHA256:tL3Mm5hn0pSKtUhZxl9CuJTMh5fFpAYxPdFq5tGlRhI(public key ending…hN/k2). It is the site’s, not the image’s. The img pull’s rsync excludes/etc/ssh/ssh_host_*, so a new image keeps it (#131).