Help us understand the problem. What is going on with this article?

Gitlabのrootユーザー(admin)のパスワードを忘れてしまった場合

More than 3 years have passed since last update.

Gitlabのrootユーザー(admin)のパスワードを忘れてしまった場合

GitlabCEのrootユーザー(admin)のパスワードを忘れてしまったため、
コンソールから強制的にパスワードリセットを実施した時のメモです。

環境

  • CentOS67
  • GitLab 7.14.1 481c966 Check

手順

Gitlabをインストールしたアカウントかサーバのrootアカウントで
サーバへsshログインして以下コマンドを実行します。

  1. gitlab-rails console production # コンソール起動(少しが時間かかります。)
  2. user = User.where(id: 1).first # rootアカウント設定モードへ
  3. user.password = 'secret_pass' # 新パスワード設定
  4. user.password_confirmation = 'secret_pass' # 新パスワード設定(確認)
  5. user.save! # 設定の保存
  6. exit # コンソールを抜ける

実行結果

[root@gitlab_server ~]# gitlab-rails console production
Loading production environment (Rails 4.1.11)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id: 1, email: "admin@example.com", 
中略
public_email: "", dashboard: 0, project_view: 0>
irb(main):002:0> user.password = 'password'
=> "password"
irb(main):003:0> user.password_confirmation = 'password'
=> "password"
irb(main):004:0> user.save!
=> true
irb(main):005:0> exit
[root@gitlab_server ~]# 

参考

How to reset your root password

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした