×

UniFi Protect - Enabling Camera SSH Access

Overview

This article explains how to enable Secure Shell (SSH) on cameras managed by UniFi Protect.

Table of Contents

  1. Introduction
  2. Enabling SSH on UniFi Protect
  3. Accessing Cameras via SSH
  4. Related Articles

Introduction

Back to Top

By default, UniFi Protect disables SSH access on managed cameras for security purposes. However, it may be necessary to enable it to access a camera directly for maintenance or recovery. This article explains how to enable SSH, along with how to access a camera directly via SSH.

Enabling SSH on UniFi Protect

Back to Top

1. Access the UniFi Cloud Key Gen2 Plus (UCK-G2-PLUS) via SSH. The SSH credentials will be the same as those used to access the Cloud Key's management portal. By default, these credentials will be ubnt/ubnt.

User Tip: Need help with SSH? See this article:Intro to Networking - How to Establish a Connection Using SSH.

2. Once credentials have been accepted, update the system packages and install Nano with the following command:

apt-get update && apt-get install nano -y

3. The following command will open the configuration file for UniFi Protect using Nano and allow editing:

nano /usr/etc/unifi-protect/config.json

4. You should see text like this:

{ "ssl": {
"crt": "/etc/ssl/private/cloudkey.crt",
"key": "/etc/ssl/private/cloudkey.key"
},
"mbToKeepFree": 32768
}

Modify the file, adding a line at the end for "enableSsh", to look like this:

{ "ssl": {
"crt": "/etc/ssl/private/cloudkey.crt",
"key": "/etc/ssl/private/cloudkey.key"
},
"mbToKeepFree": 32768,
"enableSsh": true
}

5. Use Ctrl+O, followed by Ctrl+X to save the config.json file and exit Nano.

ATTENTION:Please note that when adding the "enableSsh" line, a comma was appended at the end of the previous line (in this case after "mbToKeepFree": 32768). Without this comma, the configuration will not work.

6. Restart UniFi-Protect with one of these commands:

service unifi-protect restart

or

systemctl restart unifi-protect

Accessing Cameras via SSH

Back to Top

For additional security, the cameras' password will be different from the rest of the passwords used in UniFi Protect. This password is used for SSH access as well as for migration into another controller. To see the current password, or to change it, navigate to Settings > Device password: Edit

ssh1.png

Related Articles

Back to Top

Intro to Networking - How to Establish a Connection Using SSH

UniFi - Accounts and Passwords for Controller, Cloud Key and Other Devices

UniFi Video - How to Enable SSH on the UVC-NVR (Hardware NVR)

Was this article helpful?
6 out of 15 found this helpful
Can't find what you're looking for?
Visit our worldwide community of Ubiquiti experts for more answers
Visit the Ubiquiti Community