UniFi Controller Password Reset

This will only work on controllers 5.x and never as I understand it. I haven't tried on below that.

Find your userNAME using the following:

mongo --port 27117 ace --eval "db.admin.find().forEach(printjson);"

Set your password for “ubnt” to “ubnt”:

mongo --port 27117 ace --eval 'db.admin.update( { "name" : "ubnt" }, { $set : { "x_shadow" : "$6$udlQlboJky7$S7JsuF8hdcFJkOFm2bOcawuW0Q9utjQgDA8pcoOW9DjwVpBMYB0Nob3nrvVD4AxIV405gVs2K55xJI03Nooho/" } } )'

Generate something else than “ubnt” as password with:

mkpasswd -m sha-512