重置gitlab管理员密码
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
至此密码修改完成,可以用管理员名和修改好后的密码登陆了。
最新文章
- Socket通信综合示例
- PHP mysql_fetch_array() 函数
- String和StringBuffer的区别
- 1.3 迭代器 - iterator
- 地图坐标转换 -- 火星坐标与GPS坐标
- .net 常用Response.ContentType
- 安装DirectX SDK时出现Error Code:s1023 的解决方案
- oracle学习总结
- HttpMessageHandler管道[上篇]
- ●洛谷P3687 [ZJOI2017]仙人掌
- 撰写一篇博客要求讲述四则运算2的设计思想,源程序代码、运行结果截图、编程总结分析,并按照PSP0级的要求记录开发过程中的时间记录日志。
- keepalived主备节点都配置vip,vip切换异常案例分析
- 使用SecureCRT软件运维的配置习惯
- Oracle EBS OM 取消订单
- ios atomic nonatomic区别
- POJ 3083 Bfs+Dfs
- laravel报404错误与NGINX报404错误区别
- mysql int 整数类型 解释显示宽度 和 存储宽度
- 【BZOJ2876】【NOI2012】骑行川藏(数学,二分答案)
- C# Dictionary 复制
热门文章
- Spring的@Transactional(readOnly=true)注解,对其效果进行测试
- 系统学习javaweb补充1----HTML常用语句
- 5.redis主从配置
- WAIC | 奇点云携「酷炫AI应用」亮相2019世界人工智能大会
- 一:MYsql登录,服务开启和停止
- 【Linux_Shell 脚本编程学习笔记三、分支与循环结构】
- IntelliJ IDEA 的便捷操作性
- jquery框架概览(一)
- [LC] 142. Linked List Cycle II
- sqlserver 把两个sql查询语句查询出来的两张表合并成一张表