在 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'文章来源:https://www.toymoban.com/news/detail-464753.html
7: user.save! //如果成功,提示 true, 否则提示 false,需要查看具体问题;文章来源地址https://www.toymoban.com/news/detail-464753.html
到了这里,关于gitlab docker 忘记root密码,重新设置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!