Readers will learn how to add SSH keys to UniFi devices through the UniFi Network application.
- Applicable to the latest UniFi Network versions.
- See the How to Establish a Connection Using SSH article for more information on how to access UniFi devices using SSH.
Table of Contents
- Generating an SSH Key on Windows using PuTTYgen
- Generating an SSH Key on macOS/Linux using ssh-keygen
- Adding the SSH Key to the UniFi Network Application
- Related Articles
Generating an SSH Key on Windows using PuTTYgen
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.
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
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.
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
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
SSH key generated with ssh-keygen
Related Articles
Intro to Networking - How to Establish a Connection Using SSH