Change user role/permissions via CLI/database


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?

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?



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

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


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:

To remove 2FA from a user’s account:

1 Like

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