1.gitlab-rails console -e production
Ruby: ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
GitLab: 14.9.0-jh (51fb4a823f6) EE
GitLab Shell: 13.24.0
PostgreSQL: 12.7
2根据用户名修改密码
user = User.find_by(username: ‘username’) # 替换’username’为实际用户名
user.password = ‘newpassword’ # 设置新密码,'newpassword’为新密码
user.password_confirmation = ‘newpassword’ # 确认新密码
user.save!
不通版本的修改密码命令不一样,请查询官网获取命令