From 973d502ef1593d3bf64d234055ce78888e80a8b9 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sat, 13 Oct 2018 21:23:13 +0530 Subject: [PATCH] Create .ssh/autherized_keys as gitlab user --- debian/gitlab.postinst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/debian/gitlab.postinst b/debian/gitlab.postinst index 8ce440fcfd..6b3d3bad52 100755 --- a/debian/gitlab.postinst +++ b/debian/gitlab.postinst @@ -93,9 +93,8 @@ case "$1" in # Create directories and change ownership echo "Creating runtime directories for gitlab..." # Setup ssh key file - mkdir -p ${gitlab_data_dir}/.ssh - touch ${gitlab_data_dir}/.ssh/authorized_keys - chown -R ${gitlab_user}: ${gitlab_data_dir}/.ssh + runuser -u ${gitlab_user} -- sh -c "mkdir -p ${gitlab_data_dir}/.ssh" + runuser -u ${gitlab_user} -- sh -c "touch ${gitlab_data_dir}/.ssh/authorized_keys" # Create .bundle for .bundle/config mkdir -p ${gitlab_data_dir}/.bundle chown -R ${gitlab_user}: ${gitlab_data_dir}/.bundle