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("myuser@example.com")
user.state = "active"
user.save
exit

Use 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值