3

I forgot my local airflow webserver password, it is possible to reset it?

I tried to create a new user, but it say that my account already exists, so I would like to reset the password.

devinho
  • 404
  • 4
  • 18

4 Answers4

7

Airflow's own CLI doesn't have option to reset users password, but you can use Flask(framework that airflow is using) cli to do this

type FLASK_APP=airflow.www.app flask fab reset-password

kakoni
  • 4,980
  • 3
  • 23
  • 14
5

I just deleted my user and created another with the same name, everything is working fine.

Steps:

  1. airflow users delete -u user_name -e email (or simply providing user should also do the work).
  2. Again add the same user as below (for airflow versions >2):
airflow users create --username admin --firstname admin --lastname admin --role Admin --email admin 
devinho
  • 404
  • 4
  • 18
  • 3
    Just wanted to say, there is a lot more you can do with `airflow cheat-sheet`. It took me way too long to realize how you can manage airflow with it. – Sezai Burak Kantarcı Sep 01 '22 at 07:12
  • 1
    @devinho thanks but I wish steps were added too. Steps: 1> airflow users delete -u user_name -e email (or simply providing user should also do the work). 2> Again add the same user as below(for airflow versions >2): airflow users create --username admin --firstname admin --lastname admin --role Admin --email admin – Brijesh Oct 27 '22 at 12:12
  • @Brijesh thanks for contribution, I added it above – devinho Jan 04 '23 at 10:36
2

While there's no way to reset password for an existing user. You may delete the user and create a new one.

To list active users:

airflow users list

To delete an user:

airflow users delete -u <username>

Note: using both identifiers like username and email will throw an error. You should stick to either one of them.

To create an user:

airflow users create --username <username> --password <password> --role Admin --firstname <firstname> --lastname <lastname> --email <email>
Codistan
  • 1,469
  • 1
  • 13
  • 17
0

Steps:

  1. Delete the existing user (or simply providing user should also do the work).

airflow users delete -u user_name -e email.

  1. Again add the same user as below(for airflow versions >2):

airflow users create --username admin --firstname admin --lastname admin --role Admin --email admin

Brijesh
  • 179
  • 2
  • 5