gitlab web管理员登录密码忘记以后可以用如下方式修改密码(本演示系统为Linux-CentOS6.6):

[root@localhost ~]# gitlab-rails console production
Loading production environment (Rails 4.2.7.1)
irb(main):001:0> user=User.where(id:1).first //id为1的是超级管理员

敲回车键

=> #<User id: 1, email: "admin@example.com", created_at: "2017-02-09 11:03:08", updated_at: "2017-02-15 12:19:54", name: "Administrator", admin: true, projects_limit: 10, skype: "", linkedin: "", twitter: "", authentication_token: "M_ffJi-sRksyrz_dexor", theme_id: 2, bio: nil, username: "root", can_create_group: true, can_create_team: false, state: "active", color_scheme_id: 1, password_expires_at: nil, created_by_id: nil, last_credential_check_at: nil, avatar: nil, hide_no_ssh_key: false, website_url: "", notification_email: "admin@example.com", hide_no_password: false, password_automatically_set: false, location: nil, encrypted_otp_secret: nil, encrypted_otp_secret_iv: nil, encrypted_otp_secret_salt: nil, otp_required_for_login: false, otp_backup_codes: nil, public_email: "", dashboard: 0, project_view: 0, consumed_timestep: nil, layout: 0, hide_project_limit: false, otp_grace_period_started_at: nil, ldap_email: false, external: false, organization: nil, incoming_email_token: "dten2iwvt5zcm2su3280mybbo", authorized_projects_populated: true>

(注:红色部分标出管理员登录名)

irb(main):002:0>user.password = 'yourpassword' //密码必须至少8个字符

敲回车键
irb(main):003:0>user.save!

敲回车键

irb(main):003:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 99d8a108-2f13-4bdf-9ccc-d23d43d7a1c0) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true

// 如没有问题 返回true

至此密码修改完成,可以用管理员名和修改好后的密码登陆了。

最新文章

  1. Socket通信综合示例
  2. PHP mysql_fetch_array() 函数
  3. String和StringBuffer的区别
  4. 1.3 迭代器 - iterator
  5. 地图坐标转换 -- 火星坐标与GPS坐标
  6. .net 常用Response.ContentType
  7. 安装DirectX SDK时出现Error Code:s1023 的解决方案
  8. oracle学习总结
  9. HttpMessageHandler管道[上篇]
  10. ●洛谷P3687 [ZJOI2017]仙人掌
  11. 撰写一篇博客要求讲述四则运算2的设计思想,源程序代码、运行结果截图、编程总结分析,并按照PSP0级的要求记录开发过程中的时间记录日志。
  12. keepalived主备节点都配置vip,vip切换异常案例分析
  13. 使用SecureCRT软件运维的配置习惯
  14. Oracle EBS OM 取消订单
  15. ios atomic nonatomic区别
  16. POJ 3083 Bfs+Dfs
  17. laravel报404错误与NGINX报404错误区别
  18. mysql int 整数类型 解释显示宽度 和 存储宽度
  19. 【BZOJ2876】【NOI2012】骑行川藏(数学,二分答案)
  20. C# Dictionary 复制

热门文章

  1. Spring的@Transactional(readOnly=true)注解,对其效果进行测试
  2. 系统学习javaweb补充1----HTML常用语句
  3. 5.redis主从配置
  4. WAIC | 奇点云携「酷炫AI应用」亮相2019世界人工智能大会
  5. 一:MYsql登录,服务开启和停止
  6. 【Linux_Shell 脚本编程学习笔记三、分支与循环结构】
  7. IntelliJ IDEA 的便捷操作性
  8. jquery框架概览(一)
  9. [LC] 142. Linked List Cycle II
  10. sqlserver 把两个sql查询语句查询出来的两张表合并成一张表