The following describes my current yubikey secret setup.
The following components are part of it:
- yubikey: hardware key for gpg / ssh
- pass: password manager (see also OpenKeychain and PasswordStore android)
- gpg: commit signing, pass, encryption, .. (see also dotfiles repo)
- ssh: git, remoting, rsync, .. (see also dotfiles and tasker repo)
- using gpg --card-edit and then passwd:
- set pin
- set admin pin
- potentially set touch policy
- ykman openpgp keys set-touch %all_types_here% on
- backup / preparation
- backup old private key
- ensure all devices have all pass changes upstreamed
- new key
- create new key and push to yubikey
- tutorial pages:
- follow this page: https://support.yubico.com/s/article/Using-Your-YubiKey-with-OpenPGP
- or follow this page: https://esev.com/blog/post/2015-01-pgp-ssh-key-on-yubikey-neo/
- or use the backup on this repo
- general steps
- symlink .gnupg to usb key to ensure main key is never on computer
- gen master key, certify (auth) only
- gen subkeys x3 (enc, sign, auth)
- --armor --export pubkey to somewhere
- --armor --export-secret-key master to somewhere
- --armor --export-secret-subkeys to somewhere
- bakup rev cert to somewhere
- --expert-edit-key, toggle, key 1/2/3 to select subkeys
- keytocard all subkeys to smartcard
- rm symlink
- tutorial pages:
- change key on all devices
- push pub key to keyserver (eg https://sks.pgpkeys.eu/)
- import pub key to smartcard
- import pub key to device
- ssh
- -k --with-keygrip
- take keygrip of Authenticate subkey and put into .gnupg/sshcontrol
- create new key and push to yubikey
- update pass
- re-encrypt pass
- (yes i am aware an attacker having access to the previous version and later on getting access to a previous version of my keys, would be able to access those passwords. That just not part of my personal threat scenario)
- push pass
- get pass on all devices
- re-encrypt pass
- trust public key
- ssh-add -L to get ssh pubkey
- update trusted pub key on:
- github
- gitlab
- NAS
- ADO work
- next steps
- create next todo/cal entry for key rotation
devices:
- laptop
- work laptop
- phone
- desktop pc