Ubiquiti Unifi Protect Viewport API - Enable SSH/ADB Access
By default Ubiquiti's Viewport only has port 8080 open for management through Unifi Protect. But it does also support plaintext credentials in HTTP POST requests. After a factory reset the default credentials are ubnt:ubnt or ui:ui on some devices.
To enable SSH and ADB you need to send a POST request to the `settings` endpoint with a json object containing:
{ "username": "ubnt", "password": "ubnt", "device": { "ssh": true, "adb": true } }
Example curl command:
curl -kvH 'Content-Type: application/json' -d '{"username": "ubnt", "password": "ubnt", "device": {"ssh": true, "adb": true}}' https://192.168.0.0:8080/api/settings
Now ssh is enabled on port 22 and adb is listening on port 5555, this will stay until factory reset
You can also force a firmware update with the `update_fw` endpoint:
curl -kvH 'Content-Type: application/json' -d '{"username": "ubnt", "password": "ubnt", "uri": "https://fw-download.ubnt.com/data/unifi-protect-box/0182-android-1.4.23-55f665f0-129d-464e-b505-d459b5cee641.zip"}' https://192.168.0.0:8080/api/update_fw
You can find the latest firmware by querying https://fw-update.ubnt.com/api/firmware/{FWID}?embed=next with your devices FWID which can be found in android prop ro.ubnt.firmware.id
If you're running Protect on a isolated network where multicast doesn't work then you can force the inform url with the set_inform endpoint:
curl -kvH 'Content-Type: application/json' -d '{"username": "ubnt", "password": "ubnt", "inform_url": "192.168.0.0"}' https://192.168.0.0:8080/api/set_inform
Comments
Post a Comment