×

Intro to Networking - How to Establish a Connection Using SSH

Overview

Readers will acquire a basic understanding of the Secure Shell (SSH) network protocol and learn how to connect to a Ubiquiti device using SSH.

NOTES & REQUIREMENTS:

Table of Contents

  1. Establishing Initial Connectivity
  2. Connect via SSH on Windows
  3. Connect via SSH on macOS
  4. Connect via SSH on Linux
  5. Related Articles

Establishing Initial Connectivity

Back to Top

Most devices manufactured by Ubiquiti Networks run a Linux-based operating system, and can be interacted with at the command-line level. SSH provides a secure, encrypted method of remotely connecting to a device to access the Command Line Interface (CLI), assuming the device's IP address and access credentials are known. This allows for a safe way to read and write the configuration, access logs, and troubleshoot problems.

The WiFiman Mobile App, WiFiman Desktop and the Ubiquiti Device Discovery Tool can be used to discover Ubiquiti devices and their IP addresses.

topology.png

Accessing a Ubiquiti device (UDM-Pro) by connecting with an SSH Client on a workstation to the SSH Server on the router.

The exact steps on how to connect to the device and which credentials (username / password) to use will differ between the various Ubiquiti devices. For the most up to date information, we recommended downloading your device's Quick Start Guide (QSG) from our Download section.

NOTE: If you're having difficulty connecting to your device with SSH, try using the ping utility to verify reachability.

windows.png  Connect via SSH on Windows

Back to Top

Windows users can either install the Windows 10 OpenSSH client or use a third-party client such as PuTTY to connect using SSH.

Follow the steps below when using PuTTY:

1. Either install the program (.msi) or download and run the standalone executable (.exe).

2. Select Run if prompted by a Windows security warning.

3. Enter the IP address of the Ubiquiti device in the Host Name (or IP address) box and leave the port set to 22.

4. The first connection to a device will prompt a host key warning that asks for confirmation to continue.  Select Yes to continue connecting. 

5. A command line (terminal) window will open that prompts for a username login.

6. Enter the username of the device and press Enter.

7. A welcome banner may appear, and you will now be prompted to enter the password. As you type while entering the password, no characters will appear on screen for security purposes.  Carefully enter the correct password, and press Enter. Example output below:

login as: ubnt
ubnt@192.168.1.1's password:
NOTE:See the UniFi - Accounts and Passwords for Controller, Cloud Key, and Other Devices article for more information on default usernames and passwords for the UniFi Controller, Cloud Key and other UniFi devices.

See the EdgeRouter - User Accounts article for more information on default usernames and passwords for EdgeMAX.

8. You will be presented with the device's welcome banner if the entered credentials were valid. A command prompt indicating your username and device name will indicate a successful connection and that the remote device is ready to accept commands.

Follow the steps below when using the Windows 10 OpenSSH client:

1. Install the OpenSSH client using the instructions from the Microsoft article. 

2. Open PowerShell by navigating to Start > Windows PowerShell > Windows PowerShell.

3. A command line (terminal) window will open that accepts various input commands. 

4. Use the ssh command followed by the username and IP address of the Ubiquiti device (separated by the @ symbol).

ssh <username>@<ip-address>

5. Replace <username> and <ip-address> with the username and IP address used by the Ubiquiti device and press Enter. For example:

ssh ubnt@192.168.1.1
NOTE: See the UniFi - Accounts and Passwords for Controller, Cloud Key, and Other Devices article for more information on default usernames and passwords for the UniFi Controller, Cloud Key and other UniFi devices.

See the EdgeRouter - User Accountsarticle for more information on default usernames and passwords for EdgeMAX.

6. The first connection to a device will display a host authenticity warning and a prompt that asks for confirmation to continue.  Type yes and press Enter to continue connecting to the device. Example output below:

ssh ubnt@192.168.1.1
The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
ECDSA key fingerprint is SHA256:...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.1' (ECDSA) to the list of known hosts.
ubnt@192.168.1.1's password:

7. A welcome banner may appear, and you will now be prompted to enter the password. As you type while entering the password, no characters will appear on screen for security purposes.  Carefully enter the correct password, and press Enter.

8. You will be presented with the device's welcome banner if the entered credentials were valid. A command prompt indicating your username and device name will indicate a successful connection and that the remote device is ready to accept commands.

macos.png  Connect via SSH on maCOS

Back to Top

Follow the steps below when using the built-in macOS SSH client:

1. Open the Terminal by navigating to Applications > Utilities > Terminal.

2. A command line (terminal) window will open that accepts various input commands. 

3. Use the ssh command followed by the username and IP address of the Ubiquiti device (separated by the @ symbol).

ssh <username>@<ip-address>

4. Replace <username> and <ip-address> with the username and IP address used by the Ubiquiti device and press Enter. For example:

ssh ubnt@192.168.1.1
NOTE: See the UniFi - Accounts and Passwords for Controller, Cloud Key, and Other Devices article for more information on default usernames and passwords for the UniFi Controller, Cloud Key and other UniFi devices.

See the EdgeRouter - User Accountsarticle for more information on default usernames and passwords for EdgeMAX.

5. The first connection to a device will display a host authenticity warning and a prompt that asks for confirmation to continue.  Type yes and press Enter to continue connecting to the device. Example output below:

ssh ubnt@192.168.1.1
The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
ECDSA key fingerprint is SHA256:...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.1' (ECDSA) to the list of known hosts.
ubnt@192.168.1.1's password:

6. A welcome banner may appear, and you will now be prompted to enter the password. As you type while entering the password, no characters will appear on screen for security purposes.  Carefully enter the correct password, and press Enter.

7. You will be presented with the device's welcome banner if the entered credentials were valid. A command prompt indicating your username and device name will indicate a successful connection and that the remote device is ready to accept commands.

macos.png  Connect via SSH on Linux

Back to Top

Follow the steps below when using the built-in Linux SSH client:

1. Open the Terminal which is typically located in the Utilities > Terminal section of the main menu.  On most distributions, you can also open the Terminal by pressing CTRL+ALT+T.

2. A command line (terminal) window will open that accepts various input commands. 

3. Use the ssh command followed by the username and IP address of the Ubiquiti device (separated by the @ symbol).

ssh <username>@<ip-address>

4. Replace <username> and <ip-address> with the username and IP address used by the Ubiquiti device and press Enter. For example:

ssh ubnt@192.168.1.1
NOTE: See the UniFi - Accounts and Passwords for Controller, Cloud Key, and Other Devices article for more information on default usernames and passwords for the UniFi Controller, Cloud Key and other UniFi devices.

See the EdgeRouter - User Accountsarticle for more information on default usernames and passwords for EdgeMAX.

5. The first connection to a device will display a host authenticity warning and a prompt that asks for confirmation to continue.  Type yes and press Enter to continue connecting to the device. Example output below:

ssh ubnt@192.168.1.1
The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
ECDSA key fingerprint is SHA256:...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.1' (ECDSA) to the list of known hosts.
ubnt@192.168.1.1's password:

6. A welcome banner may appear, and you will now be prompted to enter the password. As you type while entering the password, no characters will appear on screen for security purposes.  Carefully enter the correct password, and press Enter.

7. You will be presented with the device's welcome banner if the entered credentials were valid. A command prompt indicating your username and device name will indicate a successful connection and that the remote device is ready to accept commands.

Related Articles

Back to Top

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

EdgeRouter - User Accounts

Was this article helpful?
48 out of 93 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