Skip to content

How to Reset Your Admin User Password

Kyle Gabriel edited this page Oct 27, 2020 · 4 revisions

If you cannot log in to Mycodo because you forgot your password, you have a few options to access your system again. Unless you have another admin account that you can log in and change your other user's password, you're going to have to either A) Reset your password with your email address, B) Reset your password with a reset code, C) Delete the admin user from the database then restart the web UI to induce the creation of another admin user, or D) Delete your entire database and restart the web UI to create a new database and initialize the admin user creation page.

A: Reset your password with an email address

This option is the easiest but requires you already have SMTP set up in Mycodo so it can send email and you have a valid email address associated with your account.

  1. On the login page, select "Forgot Password".
  2. Select "Email Reset Code", enter your user name, and click Submit.
  3. Check your email for the reset code. This code will be good for 30 minutes.
  4. Enter the reset code and your new password and click Change Password.

B: Reset your password by reading a file

This option requires you to have access to the file system Mycodo is installed on. A file will be created that includes a reset code and instructions.

  1. On the login page, select "Forgot Password".
  2. Select "Save Reset Code to File", enter your user name, and click Submit.
  3. Log in to the system Mycodo is installed on and open /home/pi/Mycodo/password_reset.txt to find your reset code. This code will be good for 30 minutes.
  4. Enter the reset code and your new password and click Change Password.

C: Delete the current admin user

  1. Download SQLiteStudio
  2. Download your mycodo database at ~/Mycodo/databases/mycodo.db to your local computer
  3. Open the database with SQLiteStudio and delete all admin users in the User table, then save
  4. Upload mycodo.db back to the remote system
  5. Restart the web UI with sudo service mycodoflask restart
  6. Visit your web interface and you will be presented to create a new admin user

D: Delete your database

Note: Deleting your database will mean you will be starting from scratch and will need to add all your inputs, PIDs, etc. again.

  1. Stop the Mycodo daemon with sudo service mycodo stop
  2. Delete your Mycodo database with rm -rf ~/Mycodo/databases/mycodo.db
  3. Restart the web UI with sudo service mycodoflask restart
  4. Visit your web interface and you will be presented to create a new admin user
  5. Start the Mycodo daemon with sudo service mycodo start