Skip to content

Instantly share code, notes, and snippets.

@tcrowe
Created February 6, 2019 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcrowe/ac86fba928ff9d607cad788168301170 to your computer and use it in GitHub Desktop.
Save tcrowe/ac86fba928ff9d607cad788168301170 to your computer and use it in GitHub Desktop.
new ssh host keys with "yes" confirmation
# v--automatic yes
yes | ssh-keygen -q -t ed25519 -N '' -f /etc/ssh/ssh_host_ed25519_key
yes | ssh-keygen -q -t rsa -b 2048 -N '' -f /etc/ssh/ssh_host_rsa_key
# what bits do you want? ---^
@tcrowe
Copy link
Author

tcrowe commented Feb 6, 2019

If the file exists it will ask for a confirmation. Piping yes | to ssh-keygen confirms the overwrite. (y/n)

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