gitlab docker 忘记root密码,重新设置
Posted chinabinlang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gitlab docker 忘记root密码,重新设置相关的知识,希望对你有一定的参考价值。
在 Ubuntu 上安装 gitlab docker ,非常简单方便;
安装方法:GitLab Docker images | GitLab
根据提示,可以直到 root 的默认密码在: /srv/gitlab/config/initial_root_password
一般保存一下这个文件;# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
根据 这个文件,可以知道,如果 root 密码忘记可以到这里查看处理;
# WARNING: This value is valid only in the following conditions
# 1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
# 2. Password hasn't been changed manually, either via UI or via command line.
#
# If the password shown here doesn't work, you must reset the admin password following
这里说明了一般密码重置的方法;
https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
这里说明一下:
在 通过 docker 安装 gitlab,重新设置 root 密码方法:
1: sudo docker ps -a //查看 gitlab docker id;
2: docker exec -it gitlabContainerId /bin/bash //https://docs.gitlab.com/ee/administration/operations/rails_console.html
3: gitlab-rails console -e production // 等待启动,一个Ruby 表格;
4:user.password = 't12345678' //必须 字母 和 数组组合,大于8,否则保持错误;
5:user.password = '12345678'
6:user.password_confirmation = 't12345678'
7: user.save! //如果成功,提示 true, 否则提示 false,需要查看具体问题;
以上是关于gitlab docker 忘记root密码,重新设置的主要内容,如果未能解决你的问题,请参考以下文章