All Unifi SSH Commands that You Want to Know

Even though Unifi devices come with a great controller, sometimes you need to access your Unifi device through SSH. For example, to set up the initial connection, with the set-inform command. But what other SSH Commands are available for our Unifi devices?

Unifi SSH commands are not really documented, so most commands listed in this article come from different sources and own experience. If you have any other useful SSH commands, please add them in the commands below.

Unifi SSH Commands

We are going to start with the most commonly used Unifi SSH Commands, later on, I will organize them by device or function.

CommandExampleFunction
infoinfoDisplays device information
set-defaultset-default Factory reset device
set-informset-inform http://192.168.1.1:8080/informSet URL of the controller for adoption. More info
upgradeupgrade https://<firmware-url>.binUpgrade firmware – More info
fwupdatefwupdate --url https://<firmware-url>.bin Update firmware
rebootrebootReboot the device
poweroffpoweroffShutdown device
uptimeuptimeShows device uptime
Unifi SSH Commands

Network related SSH Commands

The following Unifi SSh Commands can really help you with finding network-related issues with your Unifi Device.

CommandExampleFunction
ifconfigifconfig Show network interface information
ip address addip address add 192.168.1.143/24 dev br0Set static IP Address
ip routeip routeDisplay current gateway
ip router addip route add default via 192.168.1.1Set default gateway
echo "nameserver 192.168.1.1" > /etc/resolv.confSet DNS Server
pingping 1.1.1.1Check network connection to device
arparp -aShow arp table
ip neigh ip neigh Show IPv6 neighbors

Unifi OS SSH Commands

When you connect to your UDM Pro (or another controller that is running Unifi OS), then you will have a couple of other options:

CommandExampleFunction
ubnt-systool cputempubnt-systool cputempShow CPU Temp
ubnt-systool cpuloadubnt-systool cpuloadShow CPU load
ubnt-systool portstatusubnt-systool portstatusShow port status
ubnt-systool hostnameubnt-systool hostname <newname>Set new hostname
ubnt-systool rebootubnt-systool reboot Reboot device
ubnt-systool poweroffubnt-systool poweroffShutdown device
ubnt-systool reset2defaultsubnt-systool reset2defaults Factory reset device
ubnt-device-info summaryubnt-device-info summaryShow system information
ubnt-tools ubnt-discoverubnt-tools ubnt-discoverShow Unifi devices in the network
cat /mnt/data/udapi-config/dnsmasq.leasecat /mnt/data/udapi-config/dnsmasq.leaseShow DHCP Leases
cat /mnt/data/udapi-config/unificat /mnt/data/udapi-config/unifiShow configuration
/etc/init.d/S95unifios restart/etc/init.d/S95unifios restartRestart Unifi OS Web interface

Unifi Log files

There are a lot of log files that you can access to help you debug any Unifi related problem:

CommandFunction
cat /var/log/messagesOutput the error log
tail -f /var/log/messagesMonitor log file
cat /mnt/data/unifi-os/unifi-core/config/settings.yamlServer settings
cat /mnt/data/unifi-os/unifi-core/logs/discovery.logDiscovery log
cat /mnt/data/unifi-os/unifi-core/logs/system.logSystem log
cat /mnt/data/unifi-os/unifi/logs/server.logServer log
cat /mnt/data/unifi-os/unifi-core/logs/errors.logHttp errors

Wrapping Up

Unifi devices are running on a form of Linux, so most Linux commands will work on the devices. Pressing Tab twice will give you a list of all available SSH commands.

Keep in mind that the Unifi Controller will override most settings when you make changes directly in the device.

Get more stuff like this

IT, Office365, Smart Home, PowerShell and Blogging Tips

I hate spam to, so you can unsubscribe at any time.

27 thoughts on “All Unifi SSH Commands that You Want to Know”

  1. Is there a way I can initially ssh into a U6-Pro that’s been set up with out a controller? I obviously do not have my public key stored on the device, yet.

  2. I have a UNVR that I needed to restore with a backup file that I have. The restore failed on restoring the Users but was successful restoring all the other config and cameras. I’m still able to SSH into it, but when I try to use the SSON access, I’m not able to access it. Is there anyway to add a user and password using SSH?

  3. ‘syswrapper.sh restore-default’ and ‘mca-cli’ are both missing from the list but ‘syswrapper’ is common IMO. Also what is the difference between ‘set-default’ & ‘syswrapper.sh restore-default’? Any examples would be helpful as I’m new to UniFi. TIA!

  4. Hello Ruud, thanks for your very useful post.
    I have a UC-CK controller in OFFLINE status (seen from network.unifi.ui.com).
    But i can succesfuly ssh to the controller itself, the ifconfig configuration in OK and i can ping local and remote IPs and remote FQDN (so DNS is working fine).
    I have already rebooted the controller but no luck.
    Can you help me?

    • Has the controller ever connected successfully to the cloud? If the UCK is behind a firewall, make sure that ports Ports 80/tcp, 3478/udp, 8543/tcp and 11143/tcp are open in the firewall.

  5. ping6 to ping ipv6 of a site
    cat /var/proc/cpu to get hardware spec of the CPU for the device similarly for memory

  6. most of these don’t work on my UDMP…. for example there is no ubnt-tools in the unifi-os context… ?

    • If you type help then the command ubnt-systool won’t be listed. But when you run the command ubnt-systool cpuload, you will see the CPU load on the next line. The can be a bit unclear because depending the on terminal that you are using, you might see a # behind the output.

  7. Really minor… under Network related SSH Commands above, you show an example of arp – but your example has a typo: ‘apr -a’ instead of ‘arp -a’ 🙂

  8. Is there a command to change the GUI admin password? This would be helpful if the GUI password is lost but you still have root SSH access.

  9. I’ve got a USG-4 and almost none of these commands work.

    Does one need to “enable” or similar command to get the additional commands to work?

    I’m trying to determine which IPs are connecting through a port forwarding rule I have set up. I want to lock it down.

  10. Love it! Thank you. BTW, I’ve been unable to find the most important one to me. With the older APs no longer supported, I set them up as standalone which has a mind of its own and never takes my SSID, renaming or security settings. Do you know the CLI command to change the SSID via CLI? Love your site. Thanks, again.

    • I don’t know if there is an SSH command for it, but you can try to modify the system.cfg file:

      cat /tmp/system.cfg | grep OLDSSID

      Don’t know if it will work, you will have to try it out

Leave a Comment

0 Shares
Tweet
Pin
Share
Share