Created
November 20, 2015 14:12
-
-
Save dch/4972cce2a7dcc954bbb7 to your computer and use it in GitHub Desktop.
A dirty patch to ensure that debian systems regenerate their ssh host keys on reboot if they are missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- rc.local.orig 2015-11-20 09:02:06.776959957 -0500 | |
+++ rc.local 2015-11-20 09:02:32.096652026 -0500 | |
@@ -11,4 +11,9 @@ | |
# | |
# By default this script does nothing. | |
+if [ -f /etc/ssh/regenerate_host_keys ]; then | |
+ rm -f /etc/ssh/ssh_host_*_key* | |
+ dpkg-reconfigure openssh-server | |
+ rm /etc/ssh/regenerate_host_keys | |
+fi | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment