You'll need to do this via the command line (e.g. by SSHing into your Pi or other machine that OctoPrint is installed on - note that the password for SSHing into the Pi is not the one you use to access OctoPrint's web interface, on OctoPi it defaults to the username "pi" and password "raspberry").
OctoPrint 1.3.12+
SSH into your machine
Activate the virtual environment. On OctoPi:source ~/oprint/bin/activate
Run octoprint user password <user> with <user> being the name of the user for whom you want to reset the password, e.g. octoprint user password test for changing the password of the user named test. It will prompt you for a new password and then set it on the user.
Restart OctoPrint for your changes to take effect, using sudo service octoprint restart or similar.
OctoPrint earlier than 1.3.12
If you only have a single user set up
If you only have a single user setup in OctoPrint for which you forgot the password, the easiest way is simply resetting OctoPrint's user database and run the access control wizard again. The steps involved boil down to this:
remove ~/.octoprint/users.yaml
in ~/.octoprint/config.yaml replace firstRun: false with firstRun: true
restart the OctoPrint server and reload, you should be prompted to run the first time setup wizard again
If you are running OctoPi, you can use these commands to do all that:
rm ~/.octoprint/users.yaml
sed -i -e 's/firstRun: false/firstRun: true/g' ~/.octoprint/config.yaml
sudo service octoprint restart
Note:
If you have the OctoPrint server installed on Windows, the location of the files will be %APPDATA%\OctoPrint\users.yaml and %APPDATA%\OctoPrint\config.yaml. If you have it installed on MacOS, the locations will be ~/Library/Application\ Support/OctoPrint/users.yaml and ~/Library/Application\ Support/OctoPrint/config.yaml.
If you have multiple users set up
If you have multiple users configured which you don't want to lose, you have two options:
If you have another user that's configured with admin rights, ask them to reset your password via "Settings" > "Access Control"
If you are the only admin user, do the following:
make a backup copy of users.yaml, e.g.: cp ~/.octoprint/users.yaml ~/.octoprint/users.yaml.bck
run the access control wizard again like explained above
open the the newly created users.yaml in a text editor - there will only be one entry, your new admin account, copy all of those lines
open the backed up version of users.yaml in a text editor, locate your user account therein and replace all its lines with those you just copied from the newly created users.yaml
delete the newly created users.yaml and rename your backup version - now modified with your new credentials - into users.yaml again, e.g. mv ~/.octoprint/users.yaml.bck ~/.octoprint.users.yaml
restart OctoPrint, you should then be able to login with your new password
Where should I run these commands?
rm ~/.octoprint/users.yaml
sed -i -e 's/firstRun: false/firstRun: true/g' ~/.octoprint/config.yaml
sudo service octoprint restart
I tried to do this tonight and the first time setup wizard does not run. It just sits there with normal home page but all the details are blank and there is a login button on the top right that does nothing when I click it. I have rebooted several times.
Edit: Figured it out, emberassingly, answer below for anyone dumb enough to make my mistake.
So I am willing to admit to being an IDIOT. This might be a suggestion for Foosel though. So I am out of town and was connecting to my printer instances through a remote connection to the server I have running at home. Well I I had forgotten that while I was trying to get around some dumb stuff on another site I diasbled javascript. I'm an idiot. I figured it out when I went to try clearing cache and I saw that it was disabled..
Now for the suggestion for Gina. Octoprint's behavior when you have javascript disabled doesn't do a good job of indicating that your problem is related to javascript.. It might be worthwhile to have a warning modal when javascript is disabled. Don't believe me? Disable javascript and try to connect, it's non obvious. But since this isn't a machine I actually do any browsing on I didn't notice that it was disabled because I almost never use the browser for anything other than my octoprint servers.
Same issue as the start of this thread, all was working well and now my browser won't accept my login and password. My RPI logs in perfectly fine with these. I tried both solutions provided to change the password, to no avail. Is there a way to just disable these?