1、进入 GitLab 控制台(通过xshell等工具进入安装gitlab的那台服务器,然后操作git)
[root@localhost ~]# gitlab-rails console -e production
2.进入git账号,例如:进入root账号
irb(main):001:0> user = User.where(username:"root").first
=> #<User id:1 @root>
3.重置该账号的密码(密码长度不能小于8位)
irb(main):002:0> user.password = "12345679"
=> "12345679"
4.保存设置
irb(main):003:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 25a5a138-a99d-4f08-996c-22a88e7c23e8) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007fc2f86abdb0 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
5.退出控制台
命令: exit