GitLab是一個(gè)私有的Git倉(cāng)庫(kù),具有較好的項(xiàng)目管理和用戶(hù)管理能力。 xx
對(duì)于普通用戶(hù)而言,通過(guò)系統(tǒng)的重置密碼,接受郵件即可解決,可是GitLab的管理員賬號(hào),缺省的郵箱是一個(gè)不存在的郵箱地址,所以沒(méi)有辦法通過(guò)郵箱來(lái)復(fù)位。 ? ?
通過(guò)在服務(wù)器上,可以修改用戶(hù)的密碼:?
官方修改密碼:(http://docs.gitlab.com/ce/security/reset_root_password.html)?
具體方法如下:?
1. 在root用戶(hù)下,執(zhí)行
gitlab-railsconsoleproduction
獲得用戶(hù)數(shù)據(jù),修改用戶(hù)密碼
[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. 保存用戶(hù)數(shù)據(jù)
user.save!
注意需要使用后面的感嘆號(hào)!