gitlab 忘记root密码,修改root密码

1.使用root用户登录服务器

2.进入GitLab的安装目录,一般是 /opt/gitlab/

3.执行以下命令重置密码:

bash 复制代码
sudo gitlab-rails console

user = User.where(id: 1).first
user.password = 'new password'
user.password_confirmation = 'new password'
user.save!

退出控制台,重启GitLab服务,新密码生效

以上命令中的"new password"指的是你要设置的新密码,可以根据需要进行更改。

相关推荐
铁皮哥1 小时前
【后端/Agent 开发】给你的项目配置一套 .claude/ 工作流:别再裸用 Claude Code 了!
java·windows·python·spring·github·maven·生活
ModestCoder_2 小时前
Git 忽略所有 `.xlsx`,但保留指定 Excel 文件的方法
git·excel
阡陌..3 小时前
202605新版git_2.54.0常用操作指令
大数据·git·elasticsearch
Resistance丶未来3 小时前
Agency-Agents 多智能体协作系统落地指南
python·大模型·nlp·github·copilot·claude·gemini
輕華3 小时前
YOLOv5 实战:从 GitHub 拉取到自定义数据集训练
yolo·github
会笑的小熊4 小时前
VScode项目推送到git仓库
ide·git·vscode
zhangfeng11334 小时前
宝塔服务器完全可以安装 Git,进行版本管理,而且非常简单
运维·服务器·人工智能·git·编程
Bdygsl5 小时前
Git(1)—— 基本理解与使用
git
海域云-罗鹏6 小时前
豆包开启付费订阅,想白嫖越来越难了,企业不如部署自己的算力服务器
服务器·人工智能·github
遁神银灵子6 小时前
OMO(oh-my-openagents)插件在OpenCode Desktop v1.4.33以上版本失效问题研究
github