修改gitlab管理员账户密码

1
2
3
4
5
6
7
8
9
10
[root@cord-gitlab-128-92 ~]# gitlab-rails console production
Loading production environment (Rails 4.2.7.1)
irb(main):001:0> u = User.where(id: 1).first
=> #<User id: 1, email: "admin@example.com", created_at: "2016-11-03 10:17:48", updated_at: "2017-07-11 03:21:27", name: "Administrator", admin: true, projects_limit: 10, skype: "", linkedin: "", twitter: "", authentication_token: "eTsFFy-5tb7qXAKLS1jf", theme_id: 2, bio: nil, username: "root", can_create_group: true, can_create_team: false, state: "active", color_scheme_id: 1, password_expires_at: nil, created_by_id: nil, last_credential_check_at: nil, avatar: nil, hide_no_ssh_key: false, website_url: "", notification_email: "admin@example.com", hide_no_password: false, password_automatically_set: false, location: nil, encrypted_otp_secret: nil, encrypted_otp_secret_iv: nil, encrypted_otp_secret_salt: nil, otp_required_for_login: false, otp_backup_codes: nil, public_email: "", dashboard: 0, project_view: 0, consumed_timestep: nil, layout: 0, hide_project_limit: false, otp_grace_period_started_at: nil, ldap_email: false, external: false, organization: nil>
irb(main):002:0> u.password = 'NewPassword2017'
=> "NewPassword2017"
irb(main):003:0> u.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 6b4cf332-80c1-4b3e-a158-efb04e66940c) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
irb(main):004:0>