# Changing a password in indico 2

**URL:** <https://talk.getindico.io/t/changing-a-password-in-indico-2/347>\
**Category:** General Discussion\
**Created:** [April 18, 2018, 2:54pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347 "2018-04-18T14:54:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisrouch](https://talk.getindico.io/user_avatar/talk.getindico.io/chrisrouch/32/89_2.png) [@chrisrouch](https://talk.getindico.io/u/chrisrouch)\
**Post date:** [April 18, 2018, 2:54pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/1 "2018-04-18T14:54:50Z")

</div>

Is it possible for an administrator to change a user’s unknown password in indico2? Or is it possible for the user to request a reset link to be emailed to them? I know the latter used to be in indico1, but I can’t find it in indico 2.

Regards,

Chris

---

<div class="post-metadata">

**Author:** ![chrisrouch](https://talk.getindico.io/user_avatar/talk.getindico.io/chrisrouch/32/89_2.png) [@chrisrouch](https://talk.getindico.io/u/chrisrouch)\
**Post date:** [April 18, 2018, 2:59pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/2 "2018-04-18T14:59:56Z")

</div>

or course, just after I sent that I logged out and saw the reset link on the login page. I’m still curious if it is also possible for an admin to set a user’s password

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [April 18, 2018, 3:03pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/3 "2018-04-18T15:03:01Z")

</div>

Nope, it’s not possible (without knowing the user’s old password). It would actually make sense that an admin can change a user’s local password without having to enter the old one…

---

<div class="post-metadata">

**Author:** ![pferreir](https://talk.getindico.io/user_avatar/talk.getindico.io/pferreir/32/7_2.png) [@pferreir](https://talk.getindico.io/u/pferreir)\
**Post date:** [April 19, 2018, 12:36pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/4 "2018-04-19T12:36:04Z")

</div>

> [@ThiefMaster](#):
>
> It would actually make sense that an admin can change a user’s local password without having to enter the old one…

If you’re an admin you most likely have access to the Indico shell. Setting a new password is a one-liner.

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [April 19, 2018, 12:40pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/5 "2018-04-19T12:40:55Z")

</div>

Yeah, but it’s not super convenient, and it’ll end up in your ipython history unless you use something like `raw_input()` or `getpass()` to prompt it.

And we already have the page on account management where a user can change their own password. Wouldn’t it make sense to let an admin use that page as well, just without entering the old password? (after all, he can create a password for a user who doesn’t have one yet)

---

<div class="post-metadata">

**Author:** ![sdspacecowboy](https://talk.getindico.io/user_avatar/talk.getindico.io/sdspacecowboy/32/100_2.png) [@sdspacecowboy](https://talk.getindico.io/u/sdspacecowboy)\
**Post date:** [May 14, 2018, 5:10pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/6 "2018-05-14T17:10:54Z")

</div>

How do we activate the Indico shell?

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [May 14, 2018, 5:12pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/7 "2018-05-14T17:12:40Z")

</div>

run `indico shell` on the linux shell (while logged in via ssh to the indico user and having activated the virtualenv)

---

<div class="post-metadata">

**Author:** ![sdspacecowboy](https://talk.getindico.io/user_avatar/talk.getindico.io/sdspacecowboy/32/100_2.png) [@sdspacecowboy](https://talk.getindico.io/u/sdspacecowboy)\
**Post date:** [May 14, 2018, 6:35pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/9 "2018-05-14T18:35:27Z")

</div>

> [@pferreir](#):
>
> If you’re an admin you most likely have access to the Indico shell. Setting a new password is a one-liner.

Got into the shell. What is the command to set a new password?

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [May 14, 2018, 6:38pm UTC](https://talk.getindico.io/t/changing-a-password-in-indico-2/347/10 "2018-05-14T18:38:35Z")

</div>

```python
from getpass import getpass
u = User.get(123) # replace 123 with the user's id
u.local_identity.password = getpass() # enter the password when prompted for it
db.session.commit()

```
