Create symlinks in /etc/ssh pointing to /etc/gitlab for SSH private keys
Create symlinks in /etc/ssh pointing to /etc/gitlab for SSH private keys to fix #8326 (closed)
The current Gitlab Docker image creates SSH host keys during build in
/etc/ssh when installing openssh-server. These keys are not used.
Instead, the SSH host keys for Gitlab are generated by the wrapper
script and stored in /etc/gitlab.
Previously, the wrapper script overwrote the unused SSH public host keys
in /etc/ssh with symlinks pointing to the keys used in /etc/gitlab. The
SSH private keys were left untouched. Thus, there were SSH private keys
in /etc/ssh that were not used and the corresponding public keys in
/etc/ssh were symlinks to /etc/gitlab and the private and public keys
did not match.
Since this is could be confusing for adminstrators, this commit alters
the wrapper script so that the unused SSH private keys in /etc/ssh are
replaced with symlinks to the private keys used in /etc/gitlab.
I did a manual build of the Docker container and started a new instance and Gitlab seems to run well.
@dustinmm80 Can you do a review?
Related issues
Closes #8326 (closed)
Checklist
Required
-
MR title and description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
Latest Merge Result pipeline is green. - I'm sorry, I'm out of pipeline minutes. It looks like not all pipe jobs for the
masterbranch are currently green.
- I'm sorry, I'm out of pipeline minutes. It looks like not all pipe jobs for the
-
When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow.
For GitLab team members
If you don't have access to this, the reviewer should trigger these jobs for you during the review process.
-
The manual Trigger:ee-packagejobs have a green pipeline running against latest commit. -
If config/softwareorconfig/patchesdirectories are changed, make sure thebuild-package-on-all-osjob within theTrigger:ee-packagedownstream pipeline succeeded. -
If you are changing anything SSL related, then the Trigger:package:fipsmanual job within theTrigger:ee-packagedownstream pipeline must succeed. -
If CI configuration is changed, the branch must be pushed to dev.gitlab.orgto confirm regular branch builds aren't broken.
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes. -
Documentation created/updated. -
Tests added. -
Integration tests added to GitLab QA. -
Equivalent MR/issue for the GitLab Chart opened. -
Validate potential values for new configuration settings. Formats such as integer 10, duration10s, URIscheme://user:passwd@host:portmay require quotation or other special handling when rendered in a template and written to a configuration file.