Skip to content

Commit 1d13602

Browse files
committed
Update imaging script.
1 parent 61977a2 commit 1d13602

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

docs/image-setup.sh

+5-8
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ else
115115
echo "Error: Unsupported platform $OSTYPE, sorry" && exit 1
116116
fi
117117

118-
question "Prepare baseline Raspbian:"
119-
echo "* Flash Raspbian Lite with Etcher"
118+
question "Prepare baseline Raspberry Pi OS Lite:"
119+
echo "* Flash the OS with Raspberry Pi Imager"
120120
echo "* Eject the SD card"
121121
echo "* Mount the card back"
122122
echo "* Wait for your OS to mount it"
@@ -252,13 +252,10 @@ ssh "chromium-browser --version | cut -d ' ' -f 1-2" > temp
252252
VERSION_CHROMIUM="$(cat temp)"
253253
rm temp
254254

255-
working "Removing SSH host keys & enabling regeneration"
256-
ssh "sudo rm -f -v /etc/ssh/ssh_host_*_key* && sudo systemctl enable regenerate_ssh_host_keys"
257-
258-
working "Removing temporary SSH pubkey, disabling SSH & shutting down"
259-
tempFile="$(ssh mktemp)"
255+
working "Disabling SSH access & restoring safe defaults & shutting down"
256+
tempFile="$(ssh mktemp)" # need to do this via a temp file on the host, otherwise disabling SSH while using SSH ends up being problematic
260257
ssh "chmod a+x $tempFile"
261-
ssh "echo 'rm .ssh/authorized_keys && systemctl disable ssh && poweroff' > $tempFile"
258+
ssh "echo 'rm -f /etc/ssh/ssh_host_*_key*; systemctl enable regenerate_ssh_host_keys; rm .ssh/authorized_keys; systemctl disable ssh; poweroff' > $tempFile"
262259
ssh "sudo nohup $tempFile"
263260

264261
question "Eject the SD card from the Pi, and mount it back to this computer"

0 commit comments

Comments
 (0)