A personal collection of dotfiles and scripts for syncing settings across machines.
dotfiles docs SSH.md
1.3 kB · 33 lines
Markdown
at main

SSH #

For service-account SSH keys loaded from 1Password into ssh-agent, see docs/1PASSWORD_SSH.md. bin/link.sh symlinks .ssh-authorized_keys to ~/.ssh/authorized_keys with mode 600.

YubiKey PIV #

Set up a YubiKey PIV key in slot 9a for SSH authentication (useful when logging in to a Mac or server from Moshi on iOS without adding a fixed disk key).

Download yubico-piv-tool from Yubico Releases (see also the PIV walkthrough).

  1. Generate a new key in slot 9a and write the public key:

    yubico-piv-tool -s 9a -a generate --algorithm=ECCP256 -o public.pem
    
  2. Generate a self-signed certificate for the public key:

    yubico-piv-tool -a verify-pin -a selfsign-certificate -s 9a -S "/CN=SSH key/" -i public.pem -o cert.pem
    
  3. Import the certificate onto the YubiKey:

    yubico-piv-tool -a import-certificate -s 9a -i cert.pem
    
  4. Convert the public key for authorized_keys:

    ssh-keygen -i -m PKCS8 -f public.pem > public_ssh.pub