From 0649c693027dda57f8563cbf4b581c169978507a Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Sat, 10 May 2014 16:38:41 +0530 Subject: [PATCH] generate and store ssh host keys at the data store, fixes #62 --- Changelog.md | 1 + assets/init | 9 +++++++++ assets/setup/install | 3 +++ 3 files changed, 13 insertions(+) diff --git a/Changelog.md b/Changelog.md index d4c4e945..4fbcf6b6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,7 @@ # Changelog **latest** +- generate and store ssh host keys at the data store. - default GITLAB_PROJECTS_LIMIT is now set to 100 - use sameersbn/ubuntu:14.04.20140508 base image, the trusted build of sameersbn/ubuntu:14.04.20140505 seems to be broken - use sameersbn/ubuntu:14.04.20140505 base image diff --git a/assets/init b/assets/init index 9918bd2d..4c754576 100755 --- a/assets/init +++ b/assets/init @@ -131,6 +131,15 @@ ROOT_PASSWORD=$(pwgen -c -n -1 12) echo "root:$ROOT_PASSWORD" | chpasswd echo User: root Password: $ROOT_PASSWORD +if [ ! -e /home/git/data/ssh/ssh_host_rsa_key ]; then + # create ssh host keys and move them to the data store. + dpkg-reconfigure openssh-server + mkdir -p /home/git/data/ssh/ + mv /etc/ssh/ssh_host_*_key /etc/ssh/ssh_host_*_key.pub /home/git/data/ssh/ +fi +# configure sshd to pick up the host keys from /home/git/data/ssh/ +sed -i 's,HostKey /etc/ssh/,HostKey /home/git/data/ssh/,g' -i /etc/ssh/sshd_config + # start supervisord /usr/bin/supervisord -c /etc/supervisor/supervisord.conf supervisorctl start sshd diff --git a/assets/setup/install b/assets/setup/install index b91a5a52..a5ba006a 100755 --- a/assets/setup/install +++ b/assets/setup/install @@ -4,6 +4,9 @@ set -e GITLAB_VERSION=6.8.1 SHELL_VERSION=1.9.4 +# remove the host keys generated during openssh-server installation +rm -rf /etc/ssh/ssh_host_*_key /etc/ssh/ssh_host_*_key.pub + # add git user adduser --disabled-login --gecos 'GitLab' git passwd -d git