summaryrefslogtreecommitdiff
path: root/doc/security/unlock_user.md
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2019-07-16 07:02:20 +0000
committerAchilleas Pipinellis <axil@gitlab.com>2019-07-16 07:02:20 +0000
commit698864df12c3388d5728332d1186734a16a984e2 (patch)
tree970e38de0e9241d214646e211008c52a2c7d841c /doc/security/unlock_user.md
parent6b301c43ec01cc9968f1297dc69399c565331101 (diff)
downloadgitlab-ce-698864df12c3388d5728332d1186734a16a984e2.tar.gz
Clean-up some confusing info from security docs
Diffstat (limited to 'doc/security/unlock_user.md')
-rw-r--r--doc/security/unlock_user.md47
1 files changed, 27 insertions, 20 deletions
diff --git a/doc/security/unlock_user.md b/doc/security/unlock_user.md
index 2e14e631d68..d34826c853c 100644
--- a/doc/security/unlock_user.md
+++ b/doc/security/unlock_user.md
@@ -2,37 +2,44 @@
type: howto
---
-# How to unlock a locked user
+# How to unlock a locked user from the command line
-To unlock a locked user, first log into your server with root privileges.
+After six failed login attempts a user gets in a locked state.
-Start a Ruby on Rails console with this command:
+To unlock a locked user:
-```bash
-gitlab-rails console production
-```
+1. SSH into your GitLab server.
+1. Start a Ruby on Rails console:
-Wait until the console has loaded.
+ ```sh
+ ## For Omnibus GitLab
+ sudo gitlab-rails console production
-There are multiple ways to find your user. You can search for email or username.
+ ## For installations from source
+ sudo -u git -H bundle exec rails console RAILS_ENV=production
+ ```
-```bash
-user = User.where(id: 1).first
-```
+1. Find the user to unlock. You can search by email or ID.
-or
+ ```ruby
+ user = User.find_by(email: 'admin@local.host')
+ ```
-```bash
-user = User.find_by(email: 'admin@local.host')
-```
+ or
-Unlock the user:
+ ```ruby
+ user = User.where(id: 1).first
+ ```
-```bash
-user.unlock_access!
-```
+1. Unlock the user:
-Exit the console, the user should now be able to log in again.
+ ```ruby
+ user.unlock_access!
+ ```
+
+1. Exit the console with <kbd>Ctrl</kbd>+<kbd>d</kbd>
+
+The user should now be able to log in.
<!-- ## Troubleshooting