A few days ago, I accidentally modified the permissions of the folder under gitlab, which caused gitlab to not work normally. When I changed the permission of the file to 755, I found that gitlab can be used normally, but when using ssh password-free pull and push, gitlab will Error:
Permissions 0755 for '/etc/gitlab/ssh_host_ed25519_key' are too open.
After verification, the permissions of the files ssh_host_ed25519_key and ssh_host_rsa_key are set too large and should be set to 600.
Next, record the modification process:
- Use the docker command to enter the container
docker exec -it gitlab /bin/bash
- View the gitlab log (the problem was found by viewing the log)
gitlab-ctl tail
3. Modify file permissions
cd /etc/gitlab/
chmod 600 ssh_host_ed25519_key
chmod 600 ssh_host_rsa_key
4. Restart gitlab
gitlab-ctl stop
gitlab-ctl start