Created
June 1, 2015 16:25
-
-
Save levlaz/a3d84f2eacaf52147ce0 to your computer and use it in GitHub Desktop.
Regenerate HostKeys
This file contains 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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: ssh-host-keys | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: Regenerates SSH host keys on first boot. | |
### END INIT INFO | |
service ssh stop > /dev/null 2>&1 | |
rm -f /etc/ssh/ssh_host_* | |
dpkg-reconfigure openssh-server | |
update-rc.d ssh defaults > /dev/null 2>&1 | |
update-rc.d -f ssh-host-keys remove > /dev/null 2>&1 | |
rm -f /etc/init.d/ssh-host-keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment