其他分享
首页 > 其他分享> > gitlab密码修改启动

gitlab密码修改启动

作者:互联网

方法一:

gitlab-ce 初装以后,把密码放在了一个临时文件中了

cat /etc/gitlab/initial_root_password

Password: ARVVjpDcF5g/ZG2DScarmU9s9TKUT09HQd3qUj4jq/c=

这个文件将在首次执行reconfigure后24小时自动删除
方法2:

<root@gitlab ~># cd /opt/gitlab/bin
<root@gitlab bin># gitlab-rails console

Ruby: ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
GitLab: 14.4.1 (1a23d731c9f) FOSS
GitLab Shell: 13.21.1
PostgreSQL: 12.7

Loading production environment (Rails 6.1.4.1)
irb(main):001:0> u=User.where(id:1).first
=> #<User id:1 @root>
irb(main):002:0> User.all
=> #<ActiveRecord::Relation [#<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::MailDeliveryJob (Job ID: 2e04113b-4441-4b96-b85d-b6d8f4adc582) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f31cb855aa8 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):006:0> exit

再去登录就可以成功
修改配置后的初始化

gitlab-ctl reconfigure

启动

sudo gitlab-ctl start

停止
sudo gitlab-ctl stop

重启
sudo gitlab-ctl restart

开机启动

systemctl enable gitlab-runsvdir.service

禁止开机自启动

systemctl disable gitlab-runsvdir.service

标签:password,修改,gitlab,12345678,密码,ctl,irb,main
来源: https://www.cnblogs.com/dhcc/p/16535322.html