You will need to do the following:
- SSH into your Droplet where GitLab is installed.
ssh [your-user]@[your-droplet-ip-address]
- Open the GitLab Rails console. If you installed GitLab via the Omnibus package, you can open the Rails console with:
sudo gitlab-rails console
- Locate the
root
user and change the password. Once in the console, enter the following commands:user = User.where(id: 1).first user.password = 'new-password-here' user.password_confirmation = 'new-password-here' user.save!
- Exit the Rails console by simply typing:
exit
- Now, go to your GitLab login page and use
root
as the username and the new password you just set to log in. - If you have two-factor authentication (2FA) enabled, and you also lost access to it, you can disable it from the Rails console:
user = User.where(id: 1).first user.two_factor_enabled = false user.save!
Let me know how it goes!