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,需要查看具体问题;

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

chinabinlang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值