Files
ephemere/bash/yubikey/add-keys-to-git.sh
T
hikari b0620f2af3 refactor: reorganise bash scripts into subdirectories and add bash runner support
Move yubikey scripts from bash/ root into bash/yubikey/, move cohort shell
scripts from python/cohort/ into bash/cohort/, and update run.sh to support
Bash as a third language with category-based script discovery.
2026-02-23 20:00:44 -08:00

24 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
echo "🔄 Extracting new keys from YubiKey and updating Git config..."
# 1. Update PERSONAL (Slot 9a) -> .git-naomi
# ---------------------------------------------------------
echo " -> Processing Slot 9a (Personal)..."
KEY_9A=$(ykman piv keys export 9a - | ssh-keygen -i -m PKCS8 -f /dev/stdin)
git config -f ~/.git-naomi user.signingkey "key::$KEY_9A"
# 2. Update DEEPGRAM (Slot 9c) -> .git-dg
# ---------------------------------------------------------
echo " -> Processing Slot 9c (Deepgram)..."
KEY_9C=$(ykman piv keys export 9c - | ssh-keygen -i -m PKCS8 -f /dev/stdin)
git config -f ~/.git-dg user.signingkey "key::$KEY_9C"
# 3. Update FREECODECAMP (Slot 9e) -> .git-fcc
# ---------------------------------------------------------
echo " -> Processing Slot 9e (FreeCodeCamp)..."
KEY_9D=$(ykman piv keys export 9e - | ssh-keygen -i -m PKCS8 -f /dev/stdin)
git config -f ~/.git-fcc user.signingkey "key::$KEY_9D"
echo "✅ Done! Your local Git is now synced with your new hardware keys."
echo "⚠️ REMINDER: You must now upload these new public keys to GitHub and your 'prod' server!"