]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ganeti2/templates/instance-debootstrap/hooks/30-dsa-install-ssh-keys.erb
895d9d6b9a5aaa704de9eb88fe73dea1b49918fa
[dsa-puppet.git] / modules / ganeti2 / templates / instance-debootstrap / hooks / 30-dsa-install-ssh-keys.erb
1 #!/bin/bash
2
3 set -e
4
5 . common.sh
6
7 if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
8   echo "Missing target directory"
9   exit 1
10 fi
11
12 mkdir $TARGET/etc/ssh/userkeys
13 cat /etc/ssh/userkeys/root > $TARGET/etc/ssh/userkeys/root
14 grep '^AuthorizedKeysFile /etc/ssh/userkeys' $TARGET/etc/ssh/sshd_config || echo 'AuthorizedKeysFile /etc/ssh/userkeys/%u' >> $TARGET/etc/ssh/sshd_config
15
16 exit 0