GitLab comes with extensive troubleshooting guides
If you cannot log into GitLab using root
But you have access to the console
Use gitlab-rake
:
docker compose --project-name gitlab exec gitlab \
gitlab-rake "gitlab:password:reset[root]"
Retrieve users public keys:
curl -s http://gitlab.<DOMAIN>/<USERNAME>.keys
Find user for SSH private key:
$ ssh -T -i id_rsa git@gitlab.<DOMAIN>
Welcome to GitLab, @<USERNAME>!
Debug SSH connection and authentication:
ssh -Tvvv -i id_rsa git@gitlab.<DOMAIN>
Find user for given SSH key fingerprint:
curl --silent --header "Private-Token: admin-private-token" \
https://gitlab.example.com/api/v4/keys?fingerprint=d0:6d:2e:bb:fb:27:f1:6e:80:6c:16:b2:be:c6:d8:00 \
| jq
Find owner of access token
Example for personal access token:
curl -sH "Private-Token: <TOKEN>" http://gitlab.<DOMAIN>/api/v4/user \
| jq -r .username
<USERNAME>
Example for group access token (group ID 6):
curl -sH "Private-Token: <TOKEN>" http://gitlab.<DOMAIN>/api/v4/user \
| jq -r .username
group_6_bot
No known way to find group or project… except for log parsing for requests