gitlab docker 忘记root密码,重新设置

在 Ubuntu 上安装 gitlab docker ,非常简单方便;

安装方法:GitLab Docker images | GitLab

文章来源地址https://uudwc.com/A/L6bJ

根据提示,可以直到 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,需要查看具体问题;

原文地址:https://blog.csdn.net/chinabinlang/article/details/129494206

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请联系站长进行投诉反馈,一经查实,立即删除!

上一篇 2023年06月13日 12:10
【学习记录】云计算组网(思科CPT)
下一篇 2023年06月13日 12:10