1
0
mirror of synced 2026-01-14 23:45:13 +00:00
Stéphane Jourdois aaa6cdc60c Replace single quotes by doubles quotes in scripts
This helps make t/quoted-strings.t pass.
2010-07-16 16:27:42 +02:00

64 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
#
# This script installs OpenSSH Server on the newly created guest.
#
# It does this by generating the keys within the host, since guests
# do not have the necessary /dev/random and /dev/urandom to generate
# their own keys before boot.
#
# Dmitry Nedospasov
# --
# http://nedos.net/
prefix=$1
#
# Source our common functions
#
if [ -e /usr/lib/xen-tools/common.sh ]; then
. /usr/lib/xen-tools/common.sh
else
. ./hooks/common.sh
fi
#
# Log our start
#
logMessage Script $0 starting
#
# Since our guests doesn't have an RNG, generate the keys from the host
#
# First, create an ssh directory
#
mkdir -p ${prefix}/etc/ssh
#
# Second, Generate the Host RSA Key
#
if ssh-keygen -t rsa -N "" -f ${prefix}/etc/ssh/ssh_host_rsa_key -C "root@${hostname}"; then
logMessage "successfully generetaged Host RSA"
else
logMessage "failed to generate Host RSA Key"
fi
#
# Third, Generate the Host DSA Key
#
if ssh-keygen -t dsa -N "" -f ${prefix}/etc/ssh/ssh_host_dsa_key -C "root@${hostname}"; then
logMessage "successfully generetaged Host DSA"
else
logMessage "failed to generate Host DSA Key"
fi
#
# Install ssh
#
installDebianPackage ${prefix} openssh-server
#
# Log our finish
#
logMessage Script $0 finished