1. 登录管理后台服务器
# 如果你是用其他用户安装的,手动切换安装用户
# su - gitlab
gitlab-rails console -e production
# 如果你是docker版本安装的
docker exec -it gitlab /bin/bash
gitlab-rails console -e production
2. 查询并修改用户密码
# 根据用户名找
user = User.find_by(username: 'your_user_name')
# 根据ID找
user = User.where(id: 1).first
user.password = "your_new_password"
user.password_confirmation = "your_new_password"
user.save!
Comments | NOTHING