0

I need to get into a Ubiquiti UniFi Controller system that was setup by one of my predecessors. The admin password has long since been lost and the company now uses a different Wi-Fi system at the other offices, so there's no support contract (although I don't think Ubiquiti offers them anyhow). Also, it's a 32-bit Windows 7 laptop, so I can't use RoboMongo (64-bit only). This is at a remote office with no on-premise IT staffer, so I have to just take what little help I can get in the way of physical access.

I'm trying to follow the walk-thru here: https://medium.com/@taujago/reset-unifi-controller-password-70628fb12415

For this, I need to hash a password with SHA-512 ($6). How do I do this?

Sven
  • 98,649
  • 14
  • 180
  • 226
KidACrimson
  • 330
  • 1
  • 10
  • 26
  • @Sven♦ if you will remove the hold I will answer this question. I think it could be extremely helpful for others that may find themselves in a similar situation. – KidACrimson Nov 15 '18 at 19:13
  • No, just using a known hash is a bad idea. Read https://unix.stackexchange.com/questions/52108/how-to-create-sha512-password-hashes-on-command-line – Sven Nov 15 '18 at 19:16
  • I got my issue resolved, so I was just trying to improve the community for someone in the same situation. So I disagree, but very well. – KidACrimson Nov 30 '18 at 16:21

1 Answers1

0

The steps to resolve this for a UniFi controller hosted on 32-bit Windows were:

  1. Install MongoDB (had to be 32-bit in my case, but most people will have this on a 64-bit OS)
  2. Open elevated CMD prompt:
    CD "C:\Program Files\MongoDB\Server\3.2\bin"
    (my version was 3.2 but yours may vary)

  3. Start UniFi Controller

  4. Run this to drill into the MongoDB database:
    .\mongo —-port 27117

  5. Then change to the "ace" database:
    use ace

  6. Run this query to find your admin, email, hashes, etc (outputs in JSON .
    db.admin.find().forEach(printjson);

  7. Finally, run this command to change the new password to the SHA512 hashed & salted value of "password" (no quotes)
    db.admin.update( { name: "admin" }, {$set: { x_shadow: "$6$9Ter1EZ9$lSt6/tkoPguHqsDK0mXmUsZ1WE2qCM4m9AQ.x9/eVNJxws.hAxt2Pe8oA9TFB7LPBgzaHBcAfKFoLpRQlpBiX1" } } );

KidACrimson
  • 330
  • 1
  • 10
  • 26