12

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.

Giacomo1968
  • 58,727
MichaelM
  • 914

2 Answers2

9

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.

MichaelM
  • 914
1

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;
    
Dan
  • 393