Unifi- Forget Password

Forget Password Recovery for Unifi Controller

Introduction:

Using the following steps you will be able to perform Forget Password Recovery on Unifi Controller  based on Linux and the windows platform without resetting each and every device by starting from scratch.

Recovering Unifi Login Credentials On The Linux Platform:

  • The following command will give you a piece of information about the admin accounts on the controller: mongo –port 27117 ace –eval “db.admin.find().forEach(printjson);” 
  • Replace the <UserName> with the admin account that you want to reset in the command below.mongo –port 27117 ace –eval ‘db.admin.update( { “name” : “<UserName>” }, { $set : { “x_shadow” : “$6$ybLXKYjTNj9vv$dgGRjoXYFkw33OFZtBsp1flbCpoFQR7ac8O0FrZixHG.sw2AQmA5PuUbQC/e5.Zu.f7pGuF7qBKAfT/JRZFk8/” } } )’
  • Now you should be able to login with your admin account and password password.

Recovering Unifi Login Credentials On The Windows Platform:

  •  Download the MongoDB from here.
  • Create a folder on the C drive ( passwordrecover )

     

  • Extract mongo.exe from the bin folder into the newly created C:passwordrecover folder 
  • WINDOWS + R and type cmd ( ENTER ) 
  • Go to the folder you just created 

    cd C:/passwordrecover

     

  • Run the following commands, those commands will prompt you with all the admin account.mongo –port 27117
    use ace
    db.admin.find()
  • Now run the next command and replace with the admin account.db.admin.update( { “name” : “” }, { $set : { “x_shadow” : “$6$ybLXKYjTNj9vv$dgGRjoXYFkw33OFZtBsp1flbCpoFQR7ac8O0FrZixHG.sw2AQmA5PuUbQC/e5.Zu.f7pGuF7qBKAfT/JRZFk8/” } } )
  • You can now login with your admin account and password password

 

SMTP And Its Importance:

I will always recommend you to configure SMTP in the controller to avoid this kind of situations (Losing your login credentials).
Setting SMTP on the controller is easy and that will enable you to use the forget password option from that annoying login error (Incorrect username or password) page also, you can recover your login credentials there.

SMTP UNIFI

Here is the article on how to setup SMTP on the unifi controller:
https://help.ubnt.com/hc/en-us/articles/226590847-UniFi-How-To-Use-a-Free-Email-Service-as-SMTP-Server-Gmail-

The UniFi Controller relies on email to serve Forgot Password requests, invite administrators, and communicate device alerts.

If UniFi Cloud Access is enabled, the controller will automatically make use of the cloud services to send admin invitations (only). This will happen when “Enable Cloud Access” or “Invite to SDN” is checked on the admin invite itself. You still need to configure the SMTP settings for the controller to send most email messages (local account recovery and email alerts), and also to send admin invites without choosing “Enable Cloud Access” or “Invite to SDN”.

Note: If you have any issue with enabling the cloud access you can check the diagnosis here.

If UniFi Cloud Access will not be enabled, it is important that an SMTP server is configured to facilitate email delivery – especially for Forgot Password requests, but also for email alerts and admin invites.

NOTES & REQUIREMENTS:

  • Google may block sign-in attempts from some apps or devices, in which case you would receive an email stating that a sign-in attempt was blocked, mentioning devices that do not use modern security standards. Follow this work instruction to fix this issue. It is important to note that if your Google account has 2FA verification enabled, it will not allow you to implement this fix.
  • Gmail is used for this work instruction, but other mail service providers can be used as long as the SMTP, port and username/password are known.
  • The Settings > Controller section of the UniFi Network Controller is only available to super admins.

Testing & Verification:

Enter a valid email address that you have access to in the text box labeled “Send a test email to” and click Send. You should see a success message at the top-right corner of the browser screen, and within a few minutes, you should receive a test email confirming the email was sent successfully.

NOTE: If the UniFi Controller shows a Success message when sending the test email, but the test email is not found in the target account’s Inbox, be sure to check the All, Spam and Junk folders.

I hope the article was helpful and you have got what you were looking for. If you liked the article and if it was helpful please support and donate.

Leave a Comment