From 0b9363245ecf7125f58f1b0757bce25a56566060 Mon Sep 17 00:00:00 2001 From: Karen Carias Date: Tue, 28 Apr 2015 22:42:19 +0000 Subject: 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. -- cgit v1.2.1 From 94a426d2e66d68ef9b93075f3984040c3a22e693 Mon Sep 17 00:00:00 2001 From: Karen Carias Date: Thu, 7 May 2015 16:11:18 +0000 Subject: Added link to root password doc correctly --- doc/security/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/security/README.md b/doc/security/README.md index 49dfa6eec76..473f3632dcd 100644 --- a/doc/security/README.md +++ b/doc/security/README.md @@ -4,3 +4,4 @@ - [Rack attack](rack_attack.md) - [Web Hooks and insecure internal web services](webhooks.md) - [Information exclusivity](information_exclusivity.md) +- [Reset your root password](reset_root_password.md) \ No newline at end of file -- cgit v1.2.1 From c406bce4b57fade307bf4b563b8084f97b943cff Mon Sep 17 00:00:00 2001 From: Karen Carias Date: Thu, 7 May 2015 16:48:25 +0000 Subject: Deleted > and commented "or" out --- doc/security/reset_root_password.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/security/reset_root_password.md b/doc/security/reset_root_password.md index 58c7b0e5a77..dbbe6c3e45d 100644 --- a/doc/security/reset_root_password.md +++ b/doc/security/reset_root_password.md @@ -5,7 +5,7 @@ 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 +gitlab-rails console production ``` Wait until the console has loaded. @@ -14,15 +14,19 @@ 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 + +```bash user = User.find_by(email: 'admin@local.host') ``` Now you can change your password: ```bash -> u.password = 'secret_pass' -> u.password_confirmation = 'secret_pass' +u.password = 'secret_pass' +u.password_confirmation = 'secret_pass' ``` It's important that you change both password and password_confirmation to make it work. @@ -30,7 +34,7 @@ It's important that you change both password and password_confirmation to make i Don't forget to save the changes. ```bash -> u.save! +u.save! ``` -Exit the console and try to login with your new password. +Exit the console and try to login with your new password. \ No newline at end of file -- cgit v1.2.1 From 83c5aa6888f97082e1fd0850ff5cd071147501be Mon Sep 17 00:00:00 2001 From: Job van der Voort Date: Fri, 8 May 2015 14:35:05 +0000 Subject: remove redundant colon --- doc/security/reset_root_password.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/security/reset_root_password.md b/doc/security/reset_root_password.md index dbbe6c3e45d..d791f53adfa 100644 --- a/doc/security/reset_root_password.md +++ b/doc/security/reset_root_password.md @@ -1,4 +1,4 @@ -# How to reset your root password: +# How to reset your root password Log into your server with root privileges. Then start a Ruby on Rails console. -- cgit v1.2.1 From c74a0be9f84acc8e70e31b7f3ad322d84a0f2174 Mon Sep 17 00:00:00 2001 From: Job van der Voort Date: Fri, 8 May 2015 14:36:24 +0000 Subject: make it more obvious what happens in the code --- doc/security/reset_root_password.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/security/reset_root_password.md b/doc/security/reset_root_password.md index d791f53adfa..3c13f262677 100644 --- a/doc/security/reset_root_password.md +++ b/doc/security/reset_root_password.md @@ -13,7 +13,7 @@ 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 +user = User.where(id: 1).first ``` or @@ -25,8 +25,8 @@ user = User.find_by(email: 'admin@local.host') Now you can change your password: ```bash -u.password = 'secret_pass' -u.password_confirmation = 'secret_pass' +user.password = 'secret_pass' +user.password_confirmation = 'secret_pass' ``` It's important that you change both password and password_confirmation to make it work. @@ -34,7 +34,7 @@ It's important that you change both password and password_confirmation to make i Don't forget to save the changes. ```bash -u.save! +user.save! ``` Exit the console and try to login with your new password. \ No newline at end of file -- cgit v1.2.1