1. 程式人生 > >gItlab修改root密碼

gItlab修改root密碼

shel sem side with con confirm get post baidu

在root用戶下,執行
[root@localhost gitlab]# sudo gitlab-rails console production
-------------------------------------------------------------------------------------
 GitLab:       11.7.3 (3424476)
 GitLab Shell: 8.4.4
 postgresql:   9.6.11
-------------------------------------------------------------------------------------
Loading production environment (Rails 
5.0.7.1)
2.獲得用戶數據,修改用戶密碼
irb(main):001:0> u=User.where(id:1).first
=> #<User id:1 @root>
irb(main):003:0> u.password=12345678
=> 12345678
irb(main):004:0> u.password_confirmation=12345678
=> 12345678
irb(main):005:0> u.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 15c3c8de-e839-4874
-8104-d72dbe224756) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007f65d5b944d8 @uri=#<URI::GID gid://gitlab/User/1>> => true irb(main):006:0> quit

另:gitlab默認用戶名密碼 root 5ivel!fe

gItlab修改root密碼