From 0b9363245ecf7125f58f1b0757bce25a56566060 Mon Sep 17 00:00:00 2001 From: Karen Carias <karen@gitlab.com> Date: Tue, 28 Apr 2015 22:42:19 +0000 Subject: [PATCH] New file to add to security documentation, "How to reset your root password" --- doc/security/reset_root_password.md | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 doc/security/reset_root_password.md 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. -- GitLab