10

We have a GitLab install, currently using LDAP for authentication. Is it possible to convert an LDAP GitLab account to a regular local GitLab account? If yes, how is this done.

I can’t find anything in the admin console, and Google doesn’t seem to give anything useful.

0

2 Answers 2

7

Bah, I should of held off asking for just a little longer! How to convert an LDAP user to a regular local user in Gitlab 8:

  1. Log in as an administrator
  2. From the admin console, click the Users tab
  3. Click on the user you want to change. Note that there's a UI quirk in GitLab. If you select Edit on the user, the setting is nowhere to be found, you have to click on their name to get the setting!
  4. Click on the Identities tab for the user
  5. Delete the LDAP identity

You can then give the user a new password, OR they can password reset from the login page.

1
  • While I can delete the LDAP identity using these steps and then successfully change the password (causing a mail to be send to the user), login using the new password fails for some reason.
    – paleonix
    Aug 25, 2023 at 13:02
0

If you find yourself needing to remove LDAP from all your users at once, you can DELETE FROM identities; in gitlab's postgres database.

  1. As Gitlab's documentation is awash with warnings not to tamper directly with their database, you may want to run gitlab-backup first just to be safe.

  2. Get a shell logged in as gitlab's git user. If you've installed using docker, the command is:

    docker exec -it gitlab su - git
    

    If you've installed using one of the other methods, it's this:

    su - git
    
  3. Launch the gitlab-embedded postgres client:

    /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql gitlabhq_production gitlab
    
  4. Issue the SQL Command:

    delete from identities;
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .