GitLab
GUI: Your account has been blocked
Unblock account by CLI:
Unlock user
Vendor: https://docs.gitlab.com/ee/security/unlock_user.html
gitlab-rails console -e production
# 1 - user ID
user = User.where(id: 1).first
user. unlock_access!
Connect to DB console
# case 1
sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql/ gitlabhq_production
# case 2
sudo gitlab-rails dbconsole
Disable 2FA for all accounts
gitlab-rails runner 'User.update_all(otp_required_for_login: false, encrypted_otp_secret: "")'
# disable settings in database
gitlab-psql
update application_settings set require_two_factor_authentication=false where id=1;
Reset root password
https://docs.gitlab.com/ee/security/reset_user_password.html?tab=Linux+package+%28Omnibus%29
Gitlab in docker
docker-compose.yml
version: '3.7'
services:
gitlab:
image: 'gitlab/gitlab-ce:16.9.1-ce.0'
restart: unless-stopped
hostname: 'gitlab'
container_name: gitlab
volumes:
- ./etc:/etc/gitlab
- ./logs:/var/log/gitlab
- ./data:/var/opt/gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.loc'
ports:
- '80:80'
- '2222:22'
- '443:443'
get initial root password