# Reset Admin credentials

**URL:** <https://forum.keycloak.org/t/reset-admin-credentials/5561>\
**Category:** Miscellanaeous\
**Created:** [October 23, 2020, 2:31pm UTC](https://forum.keycloak.org/t/reset-admin-credentials/5561 "2020-10-23T14:31:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smartes](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@smartes](https://forum.keycloak.org/u/smartes)\
**Post date:** [October 23, 2020, 2:31pm UTC](https://forum.keycloak.org/t/reset-admin-credentials/5561/1 "2020-10-23T14:31:50Z")

</div>

Dear team,

I’ve been testing a local installation of keycloak a long time ago. Now that I want to login back into the admin console I’m unable to do so. It looks like I forgot the username/password.

Is there a way for me to reset the admin/password to a default one, by using for example the CLI or some tool running on the server?

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![am-titan](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/am-titan/32/1574_2.png) [@am-titan](https://forum.keycloak.org/u/am-titan)\
**Post date:** [October 27, 2020, 6:13pm UTC](https://forum.keycloak.org/t/reset-admin-credentials/5561/2 "2020-10-27T18:13:28Z")

</div>

Hi,

Yes you can do it using the CLI using the add-user-keycloak.sh script as follows:  
`sudo -u keycloak ./bin/add-user-keycloak.sh --user YourUser --password YourNewPass --realm YourRealm`  
You will add a user and you can later remove the old user.

---

<div class="post-metadata">

**Author:** ![randikam](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@randikam](https://forum.keycloak.org/u/randikam)\
**Post date:** [October 26, 2021, 2:13pm UTC](https://forum.keycloak.org/t/reset-admin-credentials/5561/3 "2021-10-26T14:13:07Z")

</div>

hi Team

When im trying above command it was failing and getting below output

root@ip-192-168-23-158:/opt/keycloak/bin# sudo -u ubuntu ./add-user-keycloak.sh --user admin --password Starlet@2hjhjk --realm Dev  
No content to map due to end-of-input  
at [Source: (FileInputStream); line: 1, column: 0]

please be kind enough to check what is missing out there

Thanks in advance
