Support Downloads Community

UniFi Video is an obsolete product line.

This application and its related devices will no longer receive any manner of technical support, including functional and security updates. Additionally, there will be no further updates to Help Center content pertaining to UniFi Video.

UniFi - Adding SSH Keys to UniFi Devices

Readers will learn how to add SSH keys to UniFi devices through the UniFi Network application. 

NOTES & REQUIREMENTS:

Table of Contents

  1. Generating an SSH Key on Windows using PuTTYgen
  2. Generating an SSH Key on macOS/Linux using ssh-keygen
  3. Adding the SSH Key to the UniFi Network Application
  4. Related Articles

windows.png  Generating an SSH Key on Windows using PuTTYgen

NOTE: On Windows 10, it is also possible to use WSL to generate SSH keys. In this case, the commands will be identical to the macOS/Linux steps below.

1. Download and install the full PuTTY installer package or the standalone PuTTYgen binary.

2. Open Putty Key Generator (PuTTYgen) to generate a new SSH key. 

3. Select RSA with a key size of 2048 and select Generate.

4. Save the public key and private key in a secure location after they have been generated.

ATTENTION: Never share the private key file or its contents.

5. Copy the complete contents of the SSH key file from the Public key for pasting into OpenSSH authorized_keys file box to your clipboard. The SSH key starts with ssh-rsa and ends with == rsa-key-<date>, for example:

ssh-rsa AbCdEfGh1234AbCdEfGh== rsa-key-20200911

macos.png  Generating an SSH Key on macOS/Linux using ssh-keygen

1. Open the macOS/Linux Terminal through the Launcher or by navigating to the Finder > Applications > Utilities section (macOS).

2. Use the ssh-keygen command to generate a new SSH Key:

ssh-keygen -t rsa

3. Either use the default file name or enter a file name of your choice and optionally add a passphrase.

ATTENTION: Never share the private key file or its contents.

4. View the contents of the public SSH key file. Assuming the file name was not changed:

cat .ssh/id_rsa.pub

5. Copy the complete contents of the SSH key file from the Terminal window to your clipboard. The SSH key starts with ssh-rsa and ends with username@machine, for example:

ssh-rsa AbCdEfGh1234AbCdEfGh admin@computer

Adding the SSH Key to the UniFi Network Application

1. Within the UniFi Network application, navigate to Settings > System Settings > Controller Configuration > Device SSH Authentication and enable the Device SSH Authentication toggle.

2. Enter a name of your choosing and paste the previously copied contents of the SSH key file and click +Add. For example (key length shortened):

SSH key generated with PuTTYgen

puttygen.png

SSH key generated with ssh-keygen

ssh-keygen.png

 

Related Articles

Intro to Networking - How to Establish a Connection Using SSH

Was this article helpful?
78 out of 165 found this helpful