diff options
author | Karen Carias <karen@gitlab.com> | 2015-04-29 01:42:19 +0300 |
---|---|---|
committer | Karen Carias <karen@gitlab.com> | 2015-04-29 01:42:19 +0300 |
commit | 0b9363245ecf7125f58f1b0757bce25a56566060 (patch) | |
tree | d8b7746727dd55832ad4a7572c3aca248c0071bd /doc/security/reset_root_password.md | |
parent | 822ba95f75858a904d20779b0d27d7f5aee2d7b7 (diff) |
New file to add to security documentation, "How to reset your root password"
Diffstat (limited to 'doc/security/reset_root_password.md')
-rw-r--r-- | doc/security/reset_root_password.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/security/reset_root_password.md b/doc/security/reset_root_password.md new file mode 100644 index 00000000000..58c7b0e5a77 --- /dev/null +++ b/doc/security/reset_root_password.md @@ -0,0 +1,36 @@ +# 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 +irb(main):001:0> u = User.where(id: 1).first +or +user = User.find_by(email: 'admin@local.host') +``` + +Now you can change your password: + +```bash +> u.password = 'secret_pass' +> u.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 +> u.save! +``` + +Exit the console and try to login with your new password. |