mirror of
https://github.com/drduh/YubiKey-Guide.git
synced 2026-07-17 14:35:18 +08:00
tidy switch key script
This commit is contained in:
parent
803e057461
commit
112b803b1d
1 changed files with 16 additions and 18 deletions
34
scripts/switch-to-backup-yubikey
Normal file → Executable file
34
scripts/switch-to-backup-yubikey
Normal file → Executable file
|
|
@ -1,23 +1,21 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# To make a duplicate Yubikey for GPG keys
|
# To duplicate YubiKey for GPG credentials:
|
||||||
# 1. Insert Yubikey1
|
# 1. Generate keys/subkeys
|
||||||
# 2. Create keys/subkeys
|
# 2. Insert first YubiKey
|
||||||
# 3. Run keytocard to transfer keys to Yubikey1
|
# 3. Run 'keytocard' to transfer keys to first YubiKey
|
||||||
# 4. QUIT WITHOUT SAVING!!!!!
|
# 4. Quit without saving!
|
||||||
#
|
#
|
||||||
# This will leave the keys on the Yubikey but NOT change the
|
# This will leave the keys on the YubiKey but NOT change the
|
||||||
# GPG keyring to point to the Yubikey1 with a stub
|
# GPG keyring to point to the first YubiKey with only a stub
|
||||||
#
|
|
||||||
# 5. Insert Yubikey2
|
|
||||||
# 6. Run keytocard to transfer keys to Yubikey2
|
|
||||||
# 7. QUIT and SAVE to make GPG point it's stubs to Yubikey2
|
|
||||||
#
|
#
|
||||||
# Running any decrypt, auth or sign will now ask you to insert Yubikey2
|
# 5. Insert second YubiKey
|
||||||
# To switch to Yubikey1 at any time run this script to force GPG
|
# 6. Run 'keytocard' to transfer keys to second YubiKey
|
||||||
# to repoint the key stubs to the inserted Yubikey
|
# 7. QUIT and SAVE to point GPG stubs to second YubiKey
|
||||||
|
#
|
||||||
read -p "Insert the Yubikey you want to use .... " ignore
|
# Running any decrypt, auth or sign will now ask to insert second YubiKey
|
||||||
echo "Switching GPG to backup Yubikey ..."
|
# To switch to the first YubiKey at any time run this script to force GPG
|
||||||
|
# to point key stubs to the currently inserted YubiKey
|
||||||
|
read -p "Insert YubiKey to use ... " ignore
|
||||||
|
echo "Switching GPG to backup YubiKey ..."
|
||||||
gpg-connect-agent "scd serialno" "learn --force" /bye
|
gpg-connect-agent "scd serialno" "learn --force" /bye
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue