jins-note

重置gitlab管理员密码

Log into your server with root privileges. Then start a Ruby on Rails console.

Start the console with this command:

gitlab-rails console 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@local.host\')

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.


分类:

技术点:

相关文章:

  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-08-05
  • 2021-09-28
  • 2021-09-05
猜你喜欢
  • 2022-12-23
  • 2022-03-05
  • 2021-12-15
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2021-09-18
相关资源
相似解决方案