ubuntu16 修改gitlab root密码

搭建了一个gitlab的git服务器,默认的管理员为root;

长时间不用root忘记了root密码;

我们可以在服务器上直接重置root的密码;

以下操作在终端下执行

#进入gitlab控制台

sudo gitlab-rails console production

#获取root用户

user = User.where(id: 1).first

#设置新密码,注意新密码要大于8位

user.password = newPwd

#再次确认新密码

user.password_confirmation = newPwd

#保存密码

user.save!

  

参考:https://docs.gitlab.com/ce/security/reset_root_password.html

猜你喜欢

转载自www.cnblogs.com/cocoajin/p/11207160.html
今日推荐