Gitlab用户密码忘记如何修改

#执行命令
root@d3b78b4b8d24:/# gitlab-rails console
Loading production environment (Rails 4.2.8)
 
#查找该用户
irb(main):001:0> user = User.where(username: 'root').first
=> #<User id:1 @root>
 
#修改密码
irb(main):002:0> user.password = '密码长度大于8个字符'
=> "lawrence"
 
#保存修改
irb(main):003:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 3add15ae-5e56-45ee-a081-564f397c9897) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/5
=> true

#ctrl+d退出

上一篇:《Rubu基础教程第五版》第十三章笔记 数组类


下一篇:Ruby笔记