gitlab Lost Password

Introduction: In the course of work before delivery operation and maintenance may not have the passwords and other important information is delivered to us, which we need to force the password to retrieve gitlab

# Step1: background login user to switch to git command-line interface, type su - git
 su - git 
 - SH - 4.2 $ gitlab- Rails Console Production's 
irb (main): 001 : 0 >  
irb (main): 002 : 0 >  
# Step2 : enter user = User.where ( ID : 1 ) .first target id = user 1 (that is, super administrator) 
IRB (main): 003 : 0 > = User.where user ( ID : 1 ) .first
 => # <the User ID : . 1 @root> 
IRB (main): 004 :0 >  
# Step3: Set the super user password is input user.password = ' my_123456 ' 
IRB (main): 004 : 0 > = user.password ' my_123456 ' 
=> " my_123456 " 
# Step4: save the configuration, the input user.save ! 
irb (main): 005 : 0 > user.save! 
ENQUEUED ActionMailer :: DeliveryJob (the Job ID: ae5ab1f5 -18fa- 4780 -ab75-05a49aff964d) to Sidekiq (mailers) with arguments The: " DeviseMailer " , " password_change " , "deliver_now " , # <GlobalID: 0x00007fe49f359298 @uri = # <URI of the GID :: gid: // gitlab / the User / 1 >> 
=> to true 
# Step5: Log gitlab Web page, enter the account password

 

Guess you like

Origin www.cnblogs.com/Mercury-linux/p/12611743.html