Skip to content

Instantly share code, notes, and snippets.

@Mr-Bossman
Created August 30, 2022 20:55
Show Gist options
  • Save Mr-Bossman/8e9ae586d10bce82f210ec36ccb8c3c6 to your computer and use it in GitHub Desktop.
Save Mr-Bossman/8e9ae586d10bce82f210ec36ccb8c3c6 to your computer and use it in GitHub Desktop.
deterministic ssh-keygen
SSH_PATH=$HOME/.ssh/id_rsa; read -ep "Enter file in which to save the key ($SSH_PATH): " -i $SSH_PATH SSH_PATH && echo "Enter seed passphrase: " && certtool --generate-privkey --outfile $SSH_PATH --key-type=rsa --sec-param=high --seed=$(perl -e '<>' | sha256sum | tr -d '-') && ssh-keygen -yf $SSH_PATH | sed "s/$/ $HOSTNAME/" > $SSH_PATH.pem
@Mr-Bossman
Copy link
Author

dependencies:
bash > 4.0
gnutls
ssh-keygen
perl
sha256sum
tr
sed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment