Skip to content

Instantly share code, notes, and snippets.

@marksharrison
Last active May 31, 2022 18:50
Show Gist options
  • Save marksharrison/98cffd9d40c7f2a800403dc0082a661f to your computer and use it in GitHub Desktop.
Save marksharrison/98cffd9d40c7f2a800403dc0082a661f to your computer and use it in GitHub Desktop.
Regenerate & replace 8192 bit OpenSSH moduli file (for the paranoid)
#!/bin/sh
# regenerate list of prime numbers to replace pre-generated list
# marginally increases security of key exchange protocols
# this will take hours or possibly days
ssh-keygen -M generate -O bits=8192 moduli-8192-regenerated.candidates
# verify regenerated list of primes are valid and not inherently weak
ssh-keygen -M screen -f moduli-8192-regenerated.candidates moduli-8192
# replace the original /etc/ssh/moduli file
cp moduli-8192 /etc/ssh/moduli
rm moduli-8192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment