rss logo

Essential SSH Commands for Managing Ubiquiti UniFi Access Points

Ubiquiti Logo

It's not uncommon to have to connect to an Ubiquiti access point via SSH, whether for management, initial setup or advanced troubleshooting.

So in this article, I'm going to cover the main SSH commands for the Ubiquiti WiFi AP I'm using.

Connect to AP via ssh

Find your device

When connecting for the first time, there are several ways of finding the IP address of the Unifi device. For example, we can monitor the address distribution of our DHCP server or use a scanning tool as Nmap.

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 don't know how to obtain the IP Address of your APs, you can use the Ubiquiti Device Discovery: https://www.ui.com/download/?q=discovery tool to find out.

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

Using Nmap

  • Simply run a scan on the SSH port, in this case on a 192.168.1.0/24 network:
root@host:~# nmap -p 22 192.168.1.0/24

Connect through ssh

  • Once we have the IP Address, we can connect via ssh (default login/password : ubnt / ubnt):
user@host:~$ ssh -l ubnt 192.168.1.20 SSH login session for Ubiquiti UniFi Access Point showing BusyBox shell prompt

ssh password for devices already registered

Here I'll show how to obtain or set the ssh password for a device registered in the Network Management Controller.

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

From the Classic interface

  • In the Site menu, check Enable advanced features and click on Apply Changes:
UniFi settings page showing how to enable advanced features and apply changes.
  • Still from the Site menu, you should now see the Device Authentication section. From here, you'll be able to display 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 display or set the ssh password:
UniFi Network settings page for enabling SSH authentication and configuring credentials.

Temporary Network Configuration

To download the latest firmware, it may be useful to know how to adjust network settings.

  • Adding 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 Default Gateway:
UBNT-BZ.v4.3.21# ip route add default via 192.168.1.254
  • Set dns:
UBNT-BZ.v4.3.21# echo "nameserver 192.168.1.254" > /etc/resolv.conf

Firmware

Firmware Upgrade

If you wish to update the firmware from ssh, first go to the https://www.ui.com/download/ web page. And get the URL of your firmware device.

Ubiquiti firmware download page with direct URL and download file button.
  • You can now 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...

Others

  • To obtain key informations such as model, version, MAC etc:
UBNT-BZ.v4.3.21# info SSH session showing Ubiquiti device information using the 'info' command
  • Reset to factory settings:
UBNT-BZ.v4.3.21# syswrapper.sh restore-default
  • Or:
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 password:
UBNT-BZ.v4.3.21# passwd
  • Reboot AP:
UBNT-BZ.v4.3.21# reboot
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address