Commit 1c911b43 authored by Job van der Voort's avatar Job van der Voort

Merge branch 'How_to_Reset_your_root_password' into 'master'

How to reset your root password

Added link and file correctly on Security doc.

Please review to make sure it's correct.

See merge request !1811
parents a1399c3c c74a0be9
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
- [Rack attack](rack_attack.md) - [Rack attack](rack_attack.md)
- [Web Hooks and insecure internal web services](webhooks.md) - [Web Hooks and insecure internal web services](webhooks.md)
- [Information exclusivity](information_exclusivity.md) - [Information exclusivity](information_exclusivity.md)
- [Reset your root password](reset_root_password.md)
\ No newline at end of file
# How to reset your root password
Log into your server with root privileges. Then start a Ruby on Rails console.
Start the console with this command:
```bash
gitlab-rails console production
```
Wait until the console has loaded.
There are multiple ways to find your user. You can search for email or username.
```bash
user = User.where(id: 1).first
```
or
```bash
user = User.find_by(email: 'admin@local.host')
```
Now you can change your password:
```bash
user.password = 'secret_pass'
user.password_confirmation = 'secret_pass'
```
It's important that you change both password and password_confirmation to make it work.
Don't forget to save the changes.
```bash
user.save!
```
Exit the console and try to login with your new password.
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment