Last active
January 15, 2024 21:07
-
-
Save cjshearer/9676d67dfd1d758cf05c64f4cfdcaa35 to your computer and use it in GitHub Desktop.
Generate encrypted SSH key with SOPS and age
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
gen-key: | |
desc: Generate encrypted ssh key | |
silent: true | |
status: | |
- test -f ssh.sops.key | |
cmds: | |
- mkfifo key key.pub | |
- defer: rm key key.pub | |
- cat key | sops -e /dev/stdin > ssh.sops.key & | |
- 'printf "Your public key:\n$(cat key.pub)\n" &' | |
- yes | ssh-keygen -t ed25519 -f key > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment