rss logo

Essential SSH Commands for Managing Ubiquiti UniFi Access Points

Ubiquiti Logo

It’s common to connect to a Ubiquiti access point via SSH—whether for configuration, management, or troubleshooting tasks.

This article presents the most useful SSH commands to manage and maintain Ubiquiti UniFi access points efficiently.

Connecting to a UniFi Access Point via SSH

Finding the Device's IP Address

When connecting to a UniFi device for the first time, you need to determine its IP address. This can be done by checking the address assignments on your DHCP server, or by using a network scanning tool such as Nmap.

Using Ubiquiti Device Discovery

Update 2024: This tool must have been too practical, which is why they removed it from the website… Thanks Ubiquiti!

If you're unsure how to obtain the IP address of your access points, you can use the Ubiquiti Device Discovery tool, available at https://www.ui.com/download/.

Ubiquiti Device Discovery tool showing detected UniFi Access Point with IP address and firmware version.

Using Nmap

  • You can scan your local network to detect devices with SSH enabled. For example, on a 192.168.1.0/24 network, run the following command:
root@host:~# nmap -p 22 192.168.1.0/24

Connect via SSH

  • Once the IP address of the device is known, you can connect to it via SSH using the default credentials: ubnt as both the username and the password:
user@host:~$ ssh -l ubnt 192.168.1.20
SSH login session for Ubiquiti UniFi Access Point showing BusyBox shell prompt

Setting the SSH Password for Registered Devices

To configure or retrieve the SSH password for a device already adopted in the Network Management Controller, follow these steps:

  • Open the Network Management Controller and go to Settings:
UniFi Network Management Controller dashboard showing network status and traffic distribution.

From the Classic interface

  • In the Site menu, enable Advanced Features and click Apply Changes:
UniFi settings page showing how to enable advanced features and apply changes.
  • Still in the Site menu, the Device Authentication section should now be visible. From there, you can view or set the SSH password:
UniFi settings page for enabling SSH authentication and setting credentials.

From the New Interface

  • In the Network Settings > Device Authentication menu, you can view or set the SSH password:
UniFi Network settings page for enabling SSH authentication and configuring credentials.

Temporary Network Configuration

To download the latest firmware directly from the internet, you may need to temporarily configure the network settings of your access point.

  • Add an IP address:
UBNT-BZ.v4.3.21# ip addr add 192.168.1.143/24 dev br0
  • Delete the default gateway:
UBNT-BZ.v4.3.21# ip route del default
  • Set a new default gateway:
UBNT-BZ.v4.3.21# ip route add default via 192.168.1.254
  • Configure DNS:
UBNT-BZ.v4.3.21# echo "nameserver 192.168.1.254" > /etc/resolv.conf

Firmware

Firmware Upgrade

To update the firmware via SSH, first visit the https://www.ui.com/download/ and locate the direct download URL for your specific device model.

Ubiquiti firmware download page with direct URL and download file button.
  • Then, run the following command on the access point to start the firmware update:
UBNT-BZ.v4.3.20# upgrade https://dl.ui.com/unifi/firmware/BZ2/4.3.21.11325/BZ.ar7240.v4.3.21.11325.200922.1739.bin
Downloading firmware from 'https://dl.ui.com/unifi/firmware/BZ2/4.3.21.11325/BZ.ar7240.v4.3.21.11325.200922.1739.bin'.

Scheduling firmware upgrade...
Waiting for upgrade to start...

Other Useful Commands

  • To retrieve key device information such as the model, firmware version, MAC address, and more, use the following command:
UBNT-BZ.v4.3.21# info
SSH session showing Ubiquiti device information using the 'info' command
  • Reset the device to factory settings:
UBNT-BZ.v4.3.21# syswrapper.sh restore-default
  • Alternative method:
UBNT-BZ.v4.3.21# set-default
  • Register the AP with the Network Management Controller:
UBNT-BZ.v4.3.21# mca-cli
UniFi# set-inform http://your.unifi.controller:8080/inform
  • Set a new device password:
UBNT-BZ.v4.3.21# passwd
  • Reboot the AP:
UBNT-BZ.v4.3.21# reboot