Created
May 8, 2015 20:08
-
-
Save yatesr/44b2d5b0e4bf87420459 to your computer and use it in GitHub Desktop.
openvz gen_ssh_host_key ubuntu-14.04
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: Generates new ssh host keys on first boot | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: Generates new ssh host keys on first boot | |
# Description: Generates new ssh host keys on first boot | |
### END INIT INFO | |
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -b 4096 -N "" | |
ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -t ed25519 -N "" | |
insserv -r /etc/init.d/ssh_gen_host_keys | |
rm -f \$0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment