Change user role/permissions via CLI/database

Hello.

I have a GitLab CE instance running in Docker.

Another person is the Owner of multiple repositories + the group I belong to as well.

Now that person quit from our project where we used GitLab for, and has deleted all his credentials. His e-mail account is also removed, so a password reset via e-mail won’t work, also had 2FA on his account.

I have access to the whole GitLab backend in Docker, so is it possible to change user roles/permissions via the GitLab config using the command line. AFAIK GitLab uses PostgreSQL to store data?

tl;dr:
I want to change the role/permissions of a user, but I cannot do that via the GitLab web UI, is there another way to accomplish this?

Thanks.

Hi,

we needed that too a while ago, and with root access to the rake console, you can do that.

https://docs.gitlab.com/ee/raketasks/user_management.html
https://docs.gitlab.com/ee/security/reset_root_password.html

Be careful with these commands, you’re working on an open heart here.

Cheers,
Michael

1 Like

Thank you Michael. I will try this later and I’ll let know how it went.

Edit 12/18: It worked using gitlab-rails inside the Docker container.

To reset the user’s password:
https://docs.gitlab.com/ee/security/reset_root_password.html

To remove 2FA from a user’s account:
https://docs.gitlab.com/ee/administration/troubleshooting/gitlab_rails_cheat_sheet.html#disable-2fa-on-a-user

1 Like

Cool, thanks for sharing all the details. I’m sure others looking for the same question will admire your research :heart:

Cheers,
Michael