# Reset user password by Admin

**URL:** https://meta.discourse.org/t/reset-user-password-by-admin/56987
**Category:** Support
**Created:** [February 6, 2017, 4:41pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987 "2017-02-06T16:41:18Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![RahulSharma](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@RahulSharma](https://meta.discourse.org/u/RahulSharma)
#### Post date: [February 6, 2017, 4:41pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/1 "2017-02-06T16:41:18Z")

</div>

Hello,

I have had an issue with a user and he is unable to reset his password due to some mail issues. I wanted to reset his password or email from admin section but I don’t find the option. Kindly let me know how to solve this issue.

One option is to ask him to create a new account, then I change the ownership of his topics to a different user but that’s a creepy method. We should have a better way to handle this right?

Regards,  
Rahul

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [February 6, 2017, 4:44pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/2 "2017-02-06T16:44:34Z")

</div>

Here is how I do it.

> [@Changing a user's email address when they can't access their account](https://meta.discourse.org/t/howto-change-a-users-email-when-they-cant-access-the-email-account/56322):
>
> bookmark This guide explains how to change a user’s email address when they can’t access their original email account and have forgotten their password. person_raising_hand Required user level: Administrator There are situations where you may need to change a user’s email address on their behalf, such as when they no longer have access to the email associated with their account. This often occurs after migrating from a preexisting system where users logged in with a username and password…

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [February 6, 2017, 4:53pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/3 "2017-02-06T16:53:27Z")

</div>

Do you know what the email issues are? Is he not receiving the emails? are they going to spam? can he not click on the password reset link in his email?

The “best” way to reset the password is for him to use the forget password and receive an email.

---

<div class="post-metadata">

### Author: ![RahulSharma](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@RahulSharma](https://meta.discourse.org/u/RahulSharma)
#### Post date: [February 6, 2017, 5:00pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/4 "2017-02-06T17:00:59Z")

</div>

He is having issue with his registered mail account and hence unable to reset. He is asking me to reset his password. That’s all. No offence, but I think the admin should have the ability to reset it to a temporary password that expires in a day.

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [February 6, 2017, 5:15pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/5 "2017-02-06T17:15:54Z")

</div>

There is no user interface for an admin to reset a password, but you can through the rails console/database access.

---

<div class="post-metadata">

### Author: ![RahulSharma](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@RahulSharma](https://meta.discourse.org/u/RahulSharma)
#### Post date: [February 6, 2017, 5:18pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/6 "2017-02-06T17:18:26Z")

</div>

Can you tell how to do that from the server shell?

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [February 6, 2017, 6:37pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/7 "2017-02-06T18:37:57Z")

</div>

First of all I would be very careful, and also backup your db.

```
ssh into your server
cd /var/discourse
./launcher enter app
rails c
u = User.find_by_email('email@test.com')
u.password='zKRR6vTZKvJAB84V9jdgeydS'
u.save!
ctrl+d to exit

```

I still think the user should figure out their email issues first though, so that they can just do a normal password reset, or change their email address for them.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 6, 2017, 8:42pm UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/8 "2017-02-06T20:42:02Z")

</div>

If you have email issues your site is doomed: nobody will be able to sign up, get notifications, etc.

---

<div class="post-metadata">

### Author: ![RahulSharma](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@RahulSharma](https://meta.discourse.org/u/RahulSharma)
#### Post date: [February 7, 2017, 5:26am UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/9 "2017-02-07T05:26:50Z")

</div>

I don’t have issues with forum mailing system. I am using SparkPost and it works great. The problem was with users mail provider which is none of my concern directly. He is receiving the activation mail but unable to login to the web client.

Well I have resolved the issue anyway. Thank you everyone and especially @blake I learned something new 🙂

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 5, 2022, 11:27am UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/10 "2022-10-05T11:27:14Z")

</div>

8 posts were split to a new topic: [Send password reset emails in bulk?](https://meta.discourse.org/t/send-password-reset-emails-in-bulk/241012)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 5, 2022, 11:27am UTC](https://meta.discourse.org/t/reset-user-password-by-admin/56987/14 "2022-10-05T11:27:29Z")

</div>


