Перейти к содержимому

Как поменять пароль в гитлабе

  • автор:

Reset a user’s password (FREE SELF)

You can reset user passwords by using the UI, a Rake task, a Rails console, or the Users API.

Prerequisites

To reset a user password, you must be an administrator of a self-managed GitLab instance.

The user’s new password must meet all password requirements.

Use the UI

To reset a user’s password in the UI:

  1. On the top bar, select Main menu > Admin.
  2. On the left sidebar, select Overview > Users.
  3. For the user whose password you want to update, select Edit ( ).
  4. In the Password area, type a password and password confirmation.
  5. Select Save changes.

A confirmation is displayed.

Use a Rake task

Use the following Rake task to reset a user’s password:

For Omnibus installations

For installations from source

GitLab requests a username, a password, and confirmation of the password. When complete, the user’s password is updated.

The Rake task can take a username as an argument. For example, to reset the password for the user with username sidneyjones :

For Omnibus installations

For installations from source

Use a Rails console

If you know the username, user ID, or email address, you can use the Rails console to reset their password:

Name already in use

gitlabhq / doc / security / reset_user_password.md

  • Go to file T
  • Go to line L
  • Copy path
  • Copy permalink
  • Open with Desktop
  • View raw
  • Copy raw contents Copy raw contents

Copy raw contents

Copy raw contents

Reset a user’s password (FREE SELF)

You can reset user passwords by using the UI, a Rake task, a Rails console, or the Users API.

To reset a user password, you must be an administrator of a self-managed GitLab instance.

The user’s new password must meet all password requirements.

To reset a user’s password in the UI:

  1. On the top bar, select Main menu > Admin.
  2. On the left sidebar, select Overview > Users.
  3. For the user whose password you want to update, select Edit ( ).
  4. In the Password area, type a password and password confirmation.
  5. Select Save changes.

A confirmation is displayed.

Use a Rake task

Use the following Rake task to reset a user’s password:

For Omnibus installations

For installations from source

GitLab requests a username, a password, and confirmation of the password. When complete, the user’s password is updated.

The Rake task can take a username as an argument. For example, to reset the password for the user with username sidneyjones :

For Omnibus installations

For installations from source

Use a Rails console

If you know the username, user ID, or email address, you can use the Rails console to reset their password:

How to reset root password on gitlab-ce (self-managed) using gitlab-rake

In this article we’ll see how to reset root password on gitlab-ce (community edition) self-managed using the embedded tool gitlab-rake .

First we need access the container of gitlab-ce (you can see How to run gitlab-ce (self-managed) on docker container), we’ll access it by container name, in my case is gitlab_ce , let’s entry with this command:

Exit fullscreen mode

Then, into the container we’ll reset the root password directly using the command bellow:

Exit fullscreen mode

The above command will request for you the new password and your confirm password. After you should see some message successfully as the image below:

Image Password successfully updated for user with username root

It’s ready! Now, you can make your login with your new password and the root login:

Example of login using root user

Thanks for reading!

Top comments (0)

For further actions, you may consider blocking this person and/or reporting abuse

How to reset user password

There are a few ways to reset the password of a user.

Rake Task

GitLab provides a Rake Task to reset passwords of users using their usernames, which can be invoked by the following command:

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.

The Rake task also takes the username as an argument, as shown in the example below:

NOTE: To reset the default admin password, run this Rake task with the username root , which is the default username of that admin account.

Rails console

The Rake task is capable of finding users via their usernames. However, if only user ID or email ID of the user is known, Rails console can be used to find user using user ID and then change password of the user manually.

Find the user either by username, user ID or email ID:

Reset the password

When using this method instead of the Users API, GitLab sends an email to the user stating that the user changed their password. If the password was changed by an administrator, execute the following command to notify the user by email:

Save the changes:

Exit the console, and then try to sign in with your new password.

NOTE: You can also reset passwords by using the Users API.

Password reset does not appear to work

If you can’t sign on with the new password, it might be because of the reconfirmation feature.

Try fixing this on the rails console. For example, if your new root password isn’t working:

Find the user and skip reconfirmation, using any of the methods above:

Try to sign in again.

Reset your root password

The previously described steps can also be used to reset the root password.

In normal installations where the username of root account hasn’t been changed manually, the Rake task can be used with username root to reset the root password.

If the username was changed to something else and has been forgotten, one possible way is to reset the password using Rails console with user ID 1 (in almost all the cases, the first user is the default admin account).

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *