Skip to content

Instantly share code, notes, and snippets.

@childnode
Created November 28, 2016 14:46
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 childnode/18de20f4448692257aa3e99c8319b70d to your computer and use it in GitHub Desktop.
Save childnode/18de20f4448692257aa3e99c8319b70d to your computer and use it in GitHub Desktop.
regenerate all hostkeys for sshd
for i in /etc/ssh/ssh_host_*_key; do ssh-keygen -f $i -t $(echo $i | awk 'BEGIN {FS= "_"} { print $3}'); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment