zoukankan      html  css  js  c++  java
  • Gitlab 重置管理员密码

    1. 当前环境。
      0 20:58:10 root@gitlab,172.16.2.6:~ # cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
    13.9.3
      0 20:58:12 root@gitlab,172.16.2.6:~ # cat /etc/redhat-release 
    CentOS Linux release 7.9.2009 (Core)
    
    1. 重置gitlab管理员密码。
      0 20:59:56 root@gitlab,172.16.2.6:~ # gitlab-rails console -e production
    --------------------------------------------------------------------------------
     Ruby:         ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
     GitLab:       13.9.3 (ea359c58edb) FOSS
     GitLab Shell: 13.17.0
     PostgreSQL:   12.5
    --------------------------------------------------------------------------------
    Loading production environment (Rails 6.0.3.4)
    irb(main):001:0> user = User.where(id: 1).first      # 指定root账户
    => #<User id:1 @root>
    irb(main):002:0> user.password = 'adsasdasdasdas'      # 设置密码
    => "adsasdasdasdas"
    irb(main):003:0> user.password_confirmation = 'password'    # 确认密码
    => "adsasdasdasdas"
    irb(main):004:0> user.save!      # 保存配置
    Enqueued ActionMailer::MailDeliveryJob (Job ID: cc20a600-f7ba-45d1-93fd-ca8e4cb4ccba) to Sidekiq(mailers) with arguments: "Dev
    => true
    irb(main):005:0> exit
    


    写作不易,转载请注明出处,谢谢~~

  • 相关阅读:
    快速幂算法
    TIME-April
    数据结构之splay树
    数据结构学习路线
    智能优化技术(四) 蚁群优化算法
    智能优化学习目录
    模式识别(四)人工神经网络
    模式识别(一) 决策树分类
    模式识别学习
    poj 2676 Sudoku
  • 原文地址:https://www.cnblogs.com/ccbloom/p/14629536.html
Copyright © 2011-2022 走看看