Created
January 28, 2017 07:49
-
-
Save f3rdy/f848ad5de91b3365415584ac8a0aab9e to your computer and use it in GitHub Desktop.
How to reset admin password in gitlab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# logon at your gitlab server | |
# | |
# $ sudo gitlab-rails console production | |
Loading production environment (Rails 4.2.7.1) | |
irb(main):001:0> user = User.where(id: 1).first | |
=> #< USER ADMIN > | |
irb(main):002:0> user.password = 'my_new_pass' | |
irb(main):003:0> user.password_confirmation = 'my_new_pass' | |
=> "my_new_pass" | |
irb(main):004:0> user.save! | |
Enqueued ActionMailer::DeliveryJob (Job ID: a-fancy-alphanumerical-id ) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1 | |
=> true |
I disagree!
this solution works fine for me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't seem to work any longer with gitlab-ce-9.5.2-ce.0.el7.x86_64 . The login page still demands we change the password again(?) by hand, if someone else hasn't beaten us to the amazon box and chowned the server.