38 lines
882 B
Plaintext
38 lines
882 B
Plaintext
# ---
|
|
# Update a user password
|
|
# ---
|
|
|
|
# directly update user passwords via the Docker console using the Rails command:
|
|
#
|
|
# User.find_by(email: "<email>").update_attribute(:password,"<new password>")
|
|
#
|
|
|
|
|
|
# 1. SSH into the server.
|
|
|
|
|
|
# 2. iEnter docker Container greenlight ( version 3.x)
|
|
#
|
|
# docker exec -it greenlight-v3 bash
|
|
#
|
|
docker exec -it greenlight-v3 bash
|
|
|
|
|
|
# 3. Run bundle 'bundle exec rails c'
|
|
#
|
|
# aae18f99e028:/usr/src/app# bundle exec rails c
|
|
#
|
|
bundle exec rails c
|
|
|
|
|
|
# 4. Change user password
|
|
#
|
|
# greenlight(prod)> User.find_by(email: "<email>").update_attribute(:password,"<new password>").
|
|
#
|
|
# or
|
|
#
|
|
# greenlight(prod)> user = User.find_by!(email: 'user@example.com')
|
|
# greenlight(prod)> user.update!(password: 'NewPassword', password_confirmation: 'NewPassword')
|
|
#
|
|
User.find_by(email: "inge@so36.net").update_attribute(:password, "pacotaibo2")
|