GitLab是一個私有的Git倉庫,具有較好的項目管理和用戶管理能力。 xx
對于普通用戶而言,通過系統(tǒng)的重置密碼,接受郵件即可解決,可是GitLab的管理員賬號,缺省的郵箱是一個不存在的郵箱地址,所以沒有辦法通過郵箱來復(fù)位。 ? ?
通過在服務(wù)器上,可以修改用戶的密碼:?
官方修改密碼:(http://docs.gitlab.com/ce/security/reset_root_password.html)?
具體方法如下:?
1. 在root用戶下,執(zhí)行
gitlab-railsconsoleproduction
獲得用戶數(shù)據(jù),修改用戶密碼
[root@svr34 bin]# gitlab-rails console production
Loading production environment (Rails 4.2.5.2)
irb(main):001:0> user = User.where(id: 1).first
=># user.password=‘12345678’
=>12345678irb(main):003:0> user.password_confirmation=‘12345678’
=>12345678irb(main):004:0> user.save!
=>trueirb(main):005:0> quit
3. 保存用戶數(shù)據(jù)
user.save!
注意需要使用后面的感嘆號!