Skip to content

Commit 0720b01

Browse files
balasankarceriktews
andcommitted
Merge branch 'ssh-private-key-symlink' into 'master'
Create symlinks in /etc/ssh pointing to /etc/gitlab for SSH private keys Closes #8326 See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7302 Merged-by: Balasankar 'Balu' C <[email protected]> Approved-by: Dustin Collins <[email protected]> Approved-by: Balasankar 'Balu' C <[email protected]> Co-authored-by: Erik Tews <[email protected]>
2 parents 769dab6 + 3197092 commit 0720b01

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docker/assets/wrapper

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ if [[ ! -f /etc/gitlab/ssh_host_rsa_key ]]; then
105105
fi
106106
# sshd loads the keys from /etc/gitlab, but the GitLab backend looks for keys
107107
# from within /etc/ssh
108+
ln -fs /etc/gitlab/ssh_host_rsa_key /etc/ssh/ssh_host_rsa_key
108109
ln -fs /etc/gitlab/ssh_host_rsa_key.pub /etc/ssh/ssh_host_rsa_key.pub
109110

110111
if [[ ! -f /etc/gitlab/ssh_host_ecdsa_key ]]; then
@@ -114,6 +115,7 @@ if [[ ! -f /etc/gitlab/ssh_host_ecdsa_key ]]; then
114115
fi
115116
# sshd loads the keys from /etc/gitlab, but the GitLab backend looks for keys
116117
# from within /etc/ssh
118+
ln -fs /etc/gitlab/ssh_host_ecdsa_key /etc/ssh/ssh_host_ecdsa_key
117119
ln -fs /etc/gitlab/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub
118120

119121
if [[ ! -f /etc/gitlab/ssh_host_ed25519_key ]]; then
@@ -123,6 +125,7 @@ if [[ ! -f /etc/gitlab/ssh_host_ed25519_key ]]; then
123125
fi
124126
# sshd loads the keys from /etc/gitlab, but the GitLab backend looks for keys
125127
# from within /etc/ssh
128+
ln -fs /etc/gitlab/ssh_host_ed25519_key /etc/ssh/ssh_host_ed25519_key
126129
ln -fs /etc/gitlab/ssh_host_ed25519_key.pub /etc/ssh/ssh_host_ed25519_key.pub
127130

128131

0 commit comments

Comments
 (0)