Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
79631c66
Commit
79631c66
authored
Mar 19, 2021
by
Ben Prescott @bprescott_↙ ☺
Committed by
Achilleas Pipinellis
Mar 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Password reset improvements
parent
d9e94018
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
doc/security/reset_user_password.md
doc/security/reset_user_password.md
+25
-6
No files found.
doc/security/reset_user_password.md
View file @
79631c66
...
@@ -11,6 +11,8 @@ There are a few ways to reset the password of a user.
...
@@ -11,6 +11,8 @@ There are a few ways to reset the password of a user.
## Rake Task
## Rake Task
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52347) in GitLab 13.9.
GitLab provides a Rake Task to reset passwords of users using their usernames,
GitLab provides a Rake Task to reset passwords of users using their usernames,
which can be invoked by the following command:
which can be invoked by the following command:
...
@@ -38,15 +40,15 @@ The Rake task is capable of finding users via their usernames. However, if only
...
@@ -38,15 +40,15 @@ 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
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.
using user ID and then change password of the user manually.
1.
Start a Rails console
1.
[
Start a Rails console
](
../administration/operations/rails_console.md
)
```shell
sudo gitlab-rails console -e production
```
1.
Find the user either by user ID or email ID:
1.
Find the user either by user
name, user
ID or email ID:
```ruby
```ruby
user = User.find_by_username 'exampleuser'
#or
user = User.find(123)
user = User.find(123)
#or
#or
...
@@ -81,6 +83,23 @@ using user ID and then change password of the user manually.
...
@@ -81,6 +83,23 @@ using user ID and then change password of the user manually.
NOTE:
NOTE:
You can also reset passwords by using the
[
Users API
](
../api/users.md#user-modification
)
.
You can also reset passwords by using the
[
Users API
](
../api/users.md#user-modification
)
.
## 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
](
../user/upgrade_email_bypass.md
)
.
Try fixing this on the rails console. For example, if your new
`root`
password isn't working:
1.
[
Start a Rails console
](
../administration/operations/rails_console.md
)
.
1.
Find the user and skip reconfirmation. Any of the methods to find the user, above, will work:
```ruby
user = User.find(1)
user.skip_reconfirmation!
```
1.
Try to sign in again.
## Reset your root password
## Reset your root password
The previously described steps can also be used to reset the root password.
The previously described steps can also be used to reset the root password.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment