• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to change the admin password on GitLab

  • 01:44 cat /etc/os-release
  • 01:59 gitlab-rails console -e production
  • 02:32 u = User.where(id:1).first
  • 03:05 u.password = ' !@#$%^& *'
  • 03:25 u.password_confirmation = ' !@#$%^& *'
  • 03:58 u.save!
  • 04:10 exit
{{postValue.id}}

To Change admin password on Gitlab.

Introduction:

Gitlab admin password can be changed easily by using GitLab-rails command. We may have chance of forgetting GitLab admin password, so if we do we actually don’t need to reinstall GitLab just follow the simple steps to reset your GitLab admin password. This tutorial covers the ground on resetting the admin password on Gitlab.

Configuration Steps:

Step 1: To check the os version.

[root@linuxhelp ~]# cat /etc/os-release
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:34"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f34/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=34
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=34
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Step 2: To execute this gitlab password rest command.

[root@linuxhelp ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
 GitLab:       14.4.2 (1ce86e92f81) 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> u.password = '!@#$%^&*'
=> "!@\#$%^&*"
irb(main):003:0> u.password_confirmation = '!@#$%^&*'
=> "!@\#$%^&*"
irb(main):004:0> u.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 58f04156-cf5e-4d90-aadb-6bae885105d3) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007fe19c8682d0 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):005:0>exit

Step 3: Then go to the browser search your gitlab and enter login details.

Snap1

Snap2

with This Gitlab admin password reset process comes to an End

Tags:
mason
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How do I reset my GitLab password?

A

GitLab asks for a username, a password, and a password confirmation. Upon giving proper values for them,
the password of the specified user is updated. To reset the default admin password, run this Rake task with
the username root , which is the default username of that administrator account.

Q

What is GitLab default password?

A

GitLab's administration interface is accessed over the web. Simply point your browser to the hostname or IP address

where GitLab is installed, and log in as an admin user. The default username is Root , and the default password is you can see this location lication "vim /etc/gitlab/initial_root_password"

Q

How do I find my GitLab password?

A

1.Rails console
2.Start a Rails console.
3.Find the user either by username, user ID or email ID: user = User.
4.Reset the password user.
5.When using this method instead of the Users API, GitLab sends an email to the user stating that the user changed their password.
6.Save the changes:

Q

What is GitLab Admin user?

A

The Admin Area provides a web UI to manage and configure some features of GitLab self-managed instances. If you are an administrator,
you can access the Admin Area by visiting /admin on your self-managed instance. ... GitLab versions 14.0 and later: on the top bar, select Menu > Admin.

Q

What is the command for gitlab password change?

A

gitlab-rails console -e production

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luk Van De Looverbosch ?
How to create a root ?

Hello,
How to create root@linuxhelp in Linux Mint 20.1 64-bit ?
Thanks in advance for your reply.
Best regards.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.