mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Merge pull request #456 from CMeza99/remove_eol
Remove init.d file for squeeze
This commit is contained in:
commit
b4db6923de
1 changed files with 0 additions and 37 deletions
|
@ -1,37 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: generate-ssh-hostkeys
|
|
||||||
# Required-Start: $local_fs
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Start:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Description-Short: Generate ssh host keys if they do not exist
|
|
||||||
# Description: Generate ssh host keys if they do not exist.
|
|
||||||
# This file was created by bootstrap-vz.
|
|
||||||
# See https://github.com/andsens/bootstrap-vz/blob/master/LICENSE for
|
|
||||||
# legal notices and disclaimers.
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
prog=$(basename $0)
|
|
||||||
logger="logger -t $prog"
|
|
||||||
|
|
||||||
rsa_key="/etc/ssh/ssh_host_rsa_key"
|
|
||||||
dsa_key="/etc/ssh/ssh_host_dsa_key"
|
|
||||||
|
|
||||||
# Exit if the hostkeys already exist
|
|
||||||
if [ -f $rsa_key -a -f $dsa_key ]; then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generate the ssh host keys
|
|
||||||
[ -f $rsa_key ] || ssh-keygen -f $rsa_key -t rsa -C 'host' -N ''
|
|
||||||
[ -f $dsa_key ] || ssh-keygen -f $dsa_key -t dsa -C 'host' -N ''
|
|
||||||
|
|
||||||
# Output the public keys to the console
|
|
||||||
# This allows user to get host keys securely through console log
|
|
||||||
echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----" | $logger
|
|
||||||
ssh-keygen -l -f $rsa_key.pub | $logger
|
|
||||||
ssh-keygen -l -f $dsa_key.pub | $logger
|
|
||||||
echo "------END SSH HOST KEY FINGERPRINTS------" | $logger
|
|
Loading…
Add table
Reference in a new issue