How to unblock an LDAP blocked user in Gitlab

来源:互联网 发布:高校大数据实验室 编辑:程序博客网 时间:2024/05/19 23:54

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 gitcd ~/gitlabbundle exec rails c productionBefore 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 executeexport PATH=$PATH:/usr/local/binif 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("myuser@example.com")user.state = "active"user.saveexitUse the real email address of the user in Gitlab instead of myuser@example.com.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("xxx@xxxx.com")
   user.state = "active"
  user.save
exit
1 0
原创粉丝点击