How-to: Reset Unifi controller password hosted on Windows

A quick guide on how to reset the password for your Unifi Controller. You only need access to the Windows machine that is hosting the controller.

Table of Contents

My setup

Machine: Windows Server 2019 1809, build 17763.737
Unifi controller: 6.1.71
NoSQLBooster: 6.2.11

Step 1. Download and install NoSQLBooster

You need a program to open the Unifi controller database.
I recommend NoSQLBooster. It’s free, easy to install and easy to use.

So, Download and install NoSQLBooster.
Link to the program: NoSQLBooster

Step 2. Connect to the database

  1. Open NoSQLBooster.
  2. Click on “Connect” in the upper left corner.
  3. Click “Create”.
    Server = localhost
    Port = 27117
  4. Click “Save & Connect”

Step 3. Changing the password

  1. Navigate to Localhost > ace > admin
  2. Click on “admin” to mark it and press enter.
  3. Doubleclick on the “x_shadow” field.
  4. Replace the current text with this: $6$OzJJ0heL$XyD5qt4pviLieuj8CMFbnSc9VYvxDyzYpH7dHC8wmaLwKv9xwyDxBiMx3GcT8nEdIa7XJbqlZo39jhfbQBXRM/
  5. Close NoSQLBooster.

Step 4. Done

The password is now password123

I advise you to change that 😉

Video guide:

Comments

20 Responses

  1. Hi,

    Posting this was the least I could do to say a huge THANK YOU to you!
    You are a legend.
    This worked and fixed my issue in seconds.
    Ubiquiti support is so horrible it’s not even funny.

    They expected me either setup SMTP on my controller (which is trash and doesn’t work with my Gmail account which I use daily) or reinstall my controller and adopt each device separately.
    Hopefully after this breach, they learn and will implement things differently.

    Once again, thank you so much!

    Regards,
    Shrian

    1. Hello,

      I have connected to this using NOSQL just fine, but when it tells me to search for the x_shadow field, i do not have any entries. I have all the directors and i am under localhost>ace>admin, but nothing else is there and it says (0) next to it.

      This is the only machine the controller is installed on. I inherited this environment from a disgruntled IT admin who locked everyone out when she left, just trying to get back into the system. Any suggestions is greatly appreciated.

  2. This worked flawlessly and took less than 5 minutes….literally!

    Thank you sooooooooooooooooo much!

  3. When I open the program I dont get the ADMIN (1) like you show. Instead it shows Admin (2) with some other options. System vs 1 and users but no admin to select?

    charlie

    1. What version is your unifi controller?
      Can you send a screenshot of your admin (2) and the other options?

  4. Thanks so much. *NOTE* I had to use the UniFi Controller program as shown in these instructions [my version 6.2.25] and not a direct query to the IP address of the controller.

  5. Thank you posting this. If this works you are a life saver! Here is the error I receive when trying to get the database.

    “message” : “failed to connect to server [localhost:27117] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27117” +
    “at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) {” +
    “name: ‘MongoNetworkError'” +
    “}]”,
    “stack” : “MongoNetworkError: failed to connect to server [localhost:27117] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27117” +
    “at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) {” +
    “name: ‘MongoNetworkError'” +
    “}]” +
    “at Pool. (C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\topologies\\server.js:438:11)” +
    “at Pool.emit (events.js:203:13)” +
    “at C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\pool.js:562:14” +
    “at C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\pool.js:995:11” +
    “at C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\connect.js:32:7” +
    “at callback (C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\connect.js:280:5)” +
    “at Socket. (C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\connect.js:310:7)” +
    “at Object.onceWrapper (events.js:291:20)” +
    “at Socket.emit (events.js:203:13)” +
    “at emitErrorNT (internal/streams/destroy.js:91:8)” +
    “at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)” +
    “at processTicksAndRejections (internal/process/task_queues.js:77:11)”,
    “name” : “MongoNetworkError”
    }

  6. It did not work for me. I have UniFi Controller 6.2.26 installed. Its the newest version. I can connect to the database using NoSQLBooster. Im navigating to localhost -> ace -> admin and then hitting enter. But no records was found :/ the admin is empty.

    1. That’s really weird. I just tried installing 6.2.26 on my own PC, it works fine here. I can’t reproduce the error you guys are getting, sorry.

  7. It didn’t work unfortunently. Im able to connect to the database using NoSQLBooster but once I navigate to Localhost -> ace -> admin and hit enter it says no records found :/

  8. I had the same problem that I could not start the Controller Setup process and ​I solved my problem by doing the following steps.

    I put the switch power-less for about 10 hours, then I start it with holding the reset button for about 30 sec and made a factory reset.

    In the next step, I uninstall the controller software made a reboot my pc.

    Then I reinstall the controller software. Now I came to the seput process of the controller software.

  9. Didn’t work for me.
    I have a Cloud Key Gen2 that has failed, but I have backups from a few days ago (and older). The cloud key was running 6.2.26.

    So I started 6.2.26 in Docker on my Macbook, then restored from the backup. Seems to have worked, except that the username/pwd didn’t work (which is how I arrived here on this page, of course).

    Using a Mac, I fired up Mongo’s own Compass software, connected to the db.

    There’s no “ace” database.
    The databases I can see are

    – admin (empty db)
    – config (empty db)
    – local (has a single collection “startup_log”)
    – unifi (has an “account” collection that looks promising, with an entry for my username. That’s probably it.
    – unifi_stat (a bunch of stats related collections)

    Changed the x_password field, but no luck when trying that pwd in the web login page.

    The entry in that account blob looks like this (seems this format is different to the one mentioned above too):

    {
    “name”: “goran”,
    “x_password”: “$6$OzJJ0heL$XyD5qt4pviLieuj8CMFbnSc9VYvxDyzYpH7dHC8wmaLwKv9xwyDxBiMx3GcT8nEdIa7XJbqlZo39jhfbQBXRM/”,
    “tunnel_type”: 3,
    “tunnel_medium_type”: 1,
    “site_id”: “61005a14”
    }

    FWIW, I’ve been authenticating using my Unifi.ui.com account, so those tunnel fields above might have to do with that (just guessing really).

    Ideas, anyone?

Leave a Reply

Your email address will not be published. Required fields are marked *