How to unblock an LDAP blocked user in Gitlab

It seems that if an LDAP user gets "LDAP blocked" intentionally or by some glitch in Gitlab then the user cannot be unblocked in the Web interface of Gitlab. This can be solved as follows on Linux.

Log onto your Linux that hosts your Gitlab, become root, and execute the following commands:
su git
cd ~/gitlab
bundle exec rails c production

Before the command "bundle exec rails c production", you may need to add the location of the file "bundle" to the variable PATH. For example, you may need to execute
export PATH=$PATH:/usr/local/bin
if the file "bundle" is in the directory /usr/local/bin.

Wait for the start of "bundle exec rails c production" and appearance of the command prompt ">". In the appeared CLI, execute the following commands:
user = User.find_by_email("[email protected]")
user.state = "active"
user.save
exit

Use the real email address of the user in Gitlab instead of [email protected].

I found this solution and posted on https://gitlab.com/gitlab-org/gitlab-ce/issues/13179.



我的步骤:

1. su git

2. cd /opt/gitlab/embedded/service/gitlab-rails
3. export PATH=$PATH:/opt/gitlab/embedded/bin/


4. bundle exec rails c production


   user = User.find_by_email("[email protected]")
   user.state = "active"
  user.save
exit

你可能感兴趣的:(How to unblock an LDAP blocked user in Gitlab)