Skip to content

Instantly share code, notes, and snippets.

@steveathon
Created November 2, 2017 00:32
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 steveathon/c409202c551b56a14920d983d9349fdb to your computer and use it in GitHub Desktop.
Save steveathon/c409202c551b56a14920d983d9349fdb to your computer and use it in GitHub Desktop.
Ubuntu script to reset OpenSSH Server Keys
#!/bin/bash
echo "Removing the existing keys... don't disconnect... :D"
/bin/rm -v /etc/ssh/ssh_host_*
# Do a Dr Who and regenerate
echo "Must.... regenerate"
dpkg-reconfigure openssh-server
# Now restart the service
service ssh restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment