summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJob van der Voort <job@gitlab.com>2015-05-08 14:36:50 +0000
committerJob van der Voort <job@gitlab.com>2015-05-08 14:36:50 +0000
commit1c911b430c86d9f5f0784005191528f0829755d1 (patch)
treeb9ab1057850a6696499705b9f7a8c70132c95a98
parenta1399c3c30798a6a14771b3d562f3d467f96c91e (diff)
parentc74a0be9f84acc8e70e31b7f3ad322d84a0f2174 (diff)
downloadgitlab-ce-1c911b430c86d9f5f0784005191528f0829755d1.tar.gz
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
-rw-r--r--doc/security/README.md1
-rw-r--r--doc/security/reset_root_password.md40
2 files changed, 41 insertions, 0 deletions
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
diff --git a/doc/security/reset_root_password.md b/doc/security/reset_root_password.md
new file mode 100644
index 00000000000..3c13f262677
--- /dev/null
+++ b/doc/security/reset_root_password.md
@@ -0,0 +1,40 @@
+# 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