Last active
October 9, 2022 15:38
-
-
Save Ham5ter/6cf693f67a1792b55f294969647a4e6a to your computer and use it in GitHub Desktop.
regenerate openssh-keys on first boot!
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/bash | |
# | |
# This Script Regenerates the OpenSSH Host Keys, and deletes itself afterwards! | |
# Put this Script in the "/etc/rc5.d/" directory. | |
# | |
# Version: 1.1 | |
# Author: [email protected] | |
# Date 02.08.2016 | |
# SPDX-License-Identifier: MIT | |
echo "Deletes the old SSH Host Keys!" | |
/bin/rm -fv /etc/ssh/ssh_host_* | |
echo "Regenerating the SSH Host Keys!" | |
dpkg-reconfigure openssh-server | |
# Delete the Script itself! | |
/bin/rm "$0" |
I updated the License, as you suggested (ham5ter here.),
Also I quote the $0
on Line 17, which in some cases might have been problematic otherwise ^^.
https://gist.github.com/Ham5ter/6cf693f67a1792b55f294969647a4e6a/revisions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are you willing to add an open source license to this?
May I suggest adding this line to the script:
# SPDX-License-Identifier: MIT