Gitlab的超級管理員忘記密碼怎么辦?


官方指導: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.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM