summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron <aaroncalderon@gmail.com>2018-07-18 16:06:31 +0000
committerRémy Coutable <remy@rymai.me>2018-08-21 19:49:54 +0200
commit07252de7dc98c0ad4b674047d68babce50a19b0c (patch)
tree848fd1aaf34d1be0bb36ac356d6fb08b1361a3fe
parente473989397aeaa2de1ae8cc0261a7233f6f01873 (diff)
downloadgitlab-ce-07252de7dc98c0ad4b674047d68babce50a19b0c.tar.gz
Add instructions to unlock an account
Originally submitted at https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6578. Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--doc/security/README.md1
-rw-r--r--doc/security/reset_root_password.md2
-rw-r--r--doc/security/unlock_user.md31
3 files changed, 33 insertions, 1 deletions
diff --git a/doc/security/README.md b/doc/security/README.md
index d397ff104ab..e22dc00759d 100644
--- a/doc/security/README.md
+++ b/doc/security/README.md
@@ -10,6 +10,7 @@ comments: false
- [Webhooks and insecure internal web services](webhooks.md)
- [Information exclusivity](information_exclusivity.md)
- [Reset your root password](reset_root_password.md)
+- [Unlock a locked user](unlock_user.md)
- [User File Uploads](user_file_uploads.md)
- [How we manage the CRIME vulnerability](crime_vulnerability.md)
- [Enforce Two-factor authentication](two_factor_authentication.md)
diff --git a/doc/security/reset_root_password.md b/doc/security/reset_root_password.md
index 3c13f262677..6a882ed6fe5 100644
--- a/doc/security/reset_root_password.md
+++ b/doc/security/reset_root_password.md
@@ -37,4 +37,4 @@ Don't forget to save the changes.
user.save!
```
-Exit the console and try to login with your new password. \ No newline at end of file
+Exit the console and try to login with your new password.
diff --git a/doc/security/unlock_user.md b/doc/security/unlock_user.md
new file mode 100644
index 00000000000..d5ecef7f605
--- /dev/null
+++ b/doc/security/unlock_user.md
@@ -0,0 +1,31 @@
+# How to unlock a locked user
+
+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')
+```
+
+Unlock the user:
+
+```bash
+user.unlock_access!
+```
+
+Exit the console, the user should now be able to log in again.