首页 > 其他 > 详细

Gitlab的超级管理员忘记密码怎么办?

时间:2020-05-01 22:12:25      阅读:122      评论:0      收藏:0      [点我收藏+]

官方指导:https://docs.gitlab.com/ce/security/reset_root_password.html

 

How to reset your root password

To reset your root password, first log into your server with root privileges.

Start a Ruby on Rails console with this command:

gitlab-rails console -e production

Wait until the console has loaded.

There are multiple ways to find your user. You can search for email or username.

user = User.where(id: 1).first

or

user = User.find_by(email: ‘admin@example.com‘)

Now you can change your password:

user.password = ‘secret_pass‘
user.password_confirmation = ‘secret_pass‘

It’s important that you change both password and password_confirmation to make it work.

Don’t forget to save the changes.

user.save!

Exit the console and try to login with your new password.

Gitlab的超级管理员忘记密码怎么办?

原文:https://www.cnblogs.com/itwlp/p/12814829.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!