Generate per-device SSH keypair instead of copying operator keys
Each device gets a unique ed25519 keypair generated at preconfig time. Private key goes to Infisical (bigbrother/SSH_PRIVKEY_<ID>), public key to the SD card only. No operator keys or identifying comments on device.
This commit is contained in:
+1
-7
@@ -75,13 +75,7 @@ if [[ $SETUP_EXIT -ne 0 ]]; then
|
||||
exit $SETUP_EXIT
|
||||
fi
|
||||
|
||||
# ── 4. Strip key comments from authorized_keys ───────────────────────────────
|
||||
step "Stripping SSH key comments (OPSEC)..."
|
||||
ssh -o StrictHostKeyChecking=no "$TARGET" \
|
||||
"awk '{print \$1, \$2}' /root/.ssh/authorized_keys > /tmp/.ak_clean && mv /tmp/.ak_clean /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys" 2>/dev/null || true
|
||||
info "Key comments stripped"
|
||||
|
||||
# ── 5. Final status ──────────────────────────────────────────────────────────
|
||||
# ── 4. Final status ──────────────────────────────────────────────────────────
|
||||
echo ""
|
||||
step "Deployment status"
|
||||
ssh -o StrictHostKeyChecking=no "$TARGET" \
|
||||
|
||||
Reference in New Issue
Block a user