segunda-feira, março 04, 2019

Ubnt unifi lost password

Some commands I used, to catch user and to "add" when needed.

 very important, find your backup, you may needed, even after you reset the password.
/var/lib/unifi/backup/autobackup/*.unf

mkpasswd -m sha-512
Password:
$6$9Ter1EZ9$lSt6/tkoPguHqsDK0mXmUsZ1WE2qCM4m9AQ.x9/eVNJxws.hAxt2Pe8oA9TFB7LPBgzaHBcAfKFoLpRQlpBiX1


password (word password in hash...)
mongo --port 27117 ace --eval 'db.admin.update( { "name" : "admin" }, { $set : { "x_shadow" : "$6$9Ter1EZ9$lSt6/tkoPguHqsDK0mXmUsZ1WE2qCM4m9AQ.x9/eVNJxws.hAxt2Pe8oA9TFB7LPBgzaHBcAfKFoLpRQlpBiX1" } } )'


https://community.ubnt.com/t5/UniFi-Wireless/Controller-not-letting-me-change-admin-password/td-p/1560207/page/2

d = { "name" : "ubnt", "lang" : "en_US", "x_password" : "ubnt" , "time_created" : "", "last_site_name" : "default"}
db.admin.insert ( d )

Execute 'mongod --dbpath /usr/lib/unifi/data/db --repair' (this broke my install)


List users admin's

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

Nenhum comentário: