1. 程式人生 > >gitlab的root用戶雙認證問題

gitlab的root用戶雙認證問題

gitlab two-factor authentication 2fa

突然用的好好的gitlab版本控制程序報雙認證的問題,而且還是root用戶,其他用戶正常。

用root登錄後就是一個報警界面,只有account和application兩個目錄能用,其他都不能正常顯示,提示需要雙因素認證 Two-Factor Authentication(2FA)。

技術分享


1、查了很多資料,都說需要手機下載google-authencator application或者 app store,掃描登錄界面二維碼不成功,填充app產生的六位PIN code也無效。


2、只有想辦法將其功能關閉,查看配置文件,沒有這方面的配置。在同事協助下,後來在一篇文章中找到了取消雙因素驗證的命令,如下


gitlab-rails runner ‘User.find_each(&:disable_two_factor!)‘

成功取消其認證功能,root恢復正常登陸使用


也有說用

gitlab-rails ‘User.update_all(otp_required_for_login: false, encrypted_otp_secret: nil, encrypted_otp_secret_iv: nil, encrypted_otp_secret_salt: nil, otp_backup_codes: nil)‘


網址如下:

https://stackoverflow.com/questions/31024771/how-to-disable-the-two-factor-authentication-in-gitlab

https://zhangmengpl.gitbooks.io/gitlab-guide/content/gitlab_wiki.html



本文出自 “雲之上” 博客,請務必保留此出處http://weimouren.blog.51cto.com/7299347/1968908

gitlab的root用戶雙認證問題