SSH UniFi Passwords : Everything you need to know

Published onby Iron (edited on )

Working with UniFi devices can be straightforward, especially when you’re familiar with SSH (Secure Shell) and the all-important passwords that come with it. SSH is like your backstage pass, giving you access to the inner workings of your UniFi gear.

With SSH, you can tweak, troubleshoot, and manage your network directly from the command line. But managing these passwords can sometimes be tricky. So, let’s explore everything you need to know about SSH UniFi passwords, from the basics to more advanced details.

Let's dive In!


🚨 Before we get to the SSH part, just a quick note: If you manage client networks on a self-hosted UniFi controller. Please stop. Sooner or later this will cause issues! It's fine for home users, but definitely not recommended for businesses. We've built UniFi hosting solution that is both secure and reliable. You can try it for free.


Table of Contents

Why SSH Is a Big Deal

SSH is essential for anyone managing UniFi devices because it lets you connect directly to your device’s operating system. This connection allows you to execute commands, change configurations, and troubleshoot problems that might not be accessible through the UniFi controller’s graphical interface.

SSH is particularly useful in complex network environments where quick access to the command line can save a lot of time and headaches.

Using SSH, you can bypass some of the limitations of the UniFi Controller’s GUI, giving you more control over your network setup. Whether you're fixing a stubborn connection issue, upgrading firmware, or reconfiguring a device, SSH is your go-to tool.

The Default SSH Credentials

When you first unbox a UniFi device, the SSH login credentials are set to the factory defaults. These are:

  • Username: "ubnt"

  • Password: "ubnt"

Using these default credentials, you can log in to your device and start configuring it. However, leaving these credentials unchanged is risky. Since the default username and password are widely known, anyone with access to your network could potentially log in to your devices. That’s why changing these credentials should be one of your first tasks.

Changing the SSH Password

Once you’ve logged in with the default credentials, it’s crucial to change the SSH password to something more secure. Here’s how you can do that:

  1. Open a Terminal:

    • On your computer, open the terminal or command prompt.
    • Type "ssh ubnt@" and hit Enter.

    • Enter the default password: "ubnt".
  2. Change the Password:

    • Once logged in, type "passwd" and press Enter.
    • You’ll be prompted to enter the current password ("ubnt") followed by your new password.
    • Re-enter the new password to confirm.

Changing the password is a simple yet effective way to secure your device, ensuring that unauthorized users can’t access it.

What to Do If You Forget the SSH Password

Forgetting your SSH password can be frustrating, but it’s not the end of the world. There are a couple of methods to recover or reset it.

Method 1: Resetting via UniFi Controller

If your device is still connected to the UniFi Controller, you can reset the SSH password directly from the controller interface.

  1. Log into the UniFi Controller:

    • Navigate to "Settings > Site > Device Authentication".
  2. Update the Password:

    • Enter a new password under the Device Password section.
    • Click Apply Changes.

This change will update the SSH password for all devices managed by that controller, making it easy to regain access.

Method 2: Factory Reset

If the device isn’t connected to the controller, you may need to perform a factory reset. This will restore the device to its default settings, including the default SSH password ("ubnt/ubnt").

  • Physical Reset:

    • Locate the reset button on the device.
    • Press and hold the button for at least 10 seconds.
    • The device will reboot with factory settings.

Keep in mind that a factory reset will erase all custom configurations, so you’ll need to reconfigure your device from scratch afterward.

Advanced SSH Commands

Once you’ve regained access to your UniFi device via SSH, you can start using more advanced commands to manage and troubleshoot your network. Here are some of the most useful commands:

  1. Check System Information:

    • Command: "info"
    • This command gives you a quick overview of your device’s status, including firmware version, uptime, and IP address.
  2. Reboot the Device:

    • Command: "reboot"
    • A simple reboot can often resolve minor issues without the need for more complex troubleshooting.
  3. Manually Update Firmware:

    • Command: "syswrapper.sh upgrade [URL to firmware]"
    • This allows you to manually update the device’s firmware by providing a direct URL to the firmware file.
  4. Change the Inform URL:

    • Command: "set-inform http://<controller_IP>:8080/inform"
    • Use this command to point your device to a new UniFi Controller if you’re migrating or re-adopting the device.

These commands give you greater control over your devices, allowing you to manage and maintain your network more effectively.

Enhancing SSH Security

While SSH is a powerful tool, it also represents a potential security risk if not properly secured. Here are some best practices to ensure your SSH setup is as secure as possible:

  1. Disable Password Authentication:

    • Consider using SSH keys instead of passwords. SSH keys provide a higher level of security because they are much harder to brute-force than passwords.
  2. Change the Default SSH Port:

    • By default, SSH runs on port 22. Changing this to a non-standard port can help reduce the risk of automated attacks by bots that scan for open SSH ports.
  3. Enable Two-Factor Authentication (2FA):

    • Adding a second layer of security with 2FA can help protect your devices even if your SSH credentials are compromised.
  4. Monitor SSH Access Logs:

    • Regularly check your access logs to see who has been logging into your devices. On most Linux-based systems, these logs are stored in "/var/log/auth.log".

Implementing these security measures can significantly reduce the risk of unauthorized access to your network.

Troubleshooting Common SSH Issues

Even with the best setup, things can sometimes go wrong. Here are some common SSH issues you might encounter and how to fix them:

1. SSH Connection Refused

If you get a "Connection Refused" error, it could be due to several reasons:

  • SSH Service Not Running: Make sure the SSH service is running on the UniFi device.

  • Firewall Blocking SSH: Ensure that your firewall settings allow SSH connections.

  • Incorrect IP Address: Double-check the IP address you’re trying to connect to.

2. Permission Denied (Publickey)

This error usually means that the SSH server is configured to accept only SSH key authentication, but you haven’t provided a valid key. You’ll need to either configure your SSH client to use the correct key or switch back to password authentication on the server side.

3. Slow SSH Login

If your SSH login is slow, it might be due to DNS resolution issues. You can speed things up by disabling DNS lookups in your SSH configuration:

  • Edit the "/etc/ssh/sshd_config" file on your UniFi device.
  • Add or modify the line: "UseDNS no"
  • Restart the SSH service: "service ssh restart"

Addressing these issues will help you maintain a smooth and reliable SSH connection.

Final Thoughts

SSH is an indispensable tool for anyone managing UniFi devices. It gives you the power to control, configure, and troubleshoot your network directly from the command line. But with that power comes the responsibility of managing your SSH passwords and security settings carefully.

Always remember to change default passwords, secure your SSH connections with best practices, and keep a close eye on your logs.

At UniHosted, we understand the challenges of managing multiple UniFi devices and the importance of keeping your network secure. That’s why we offer cloud-based UniFi Controller hosting that takes care of the heavy lifting, so you can focus on what matters most—keeping your network running smoothly.

If you would like me to personally walk you through UniHosted, you can schedule a call with me here.

We host UniFi Controllers in the Cloud

Are you ready to take your UniFi Network to the next level? Deploy a UniFi Cloud Controller in minutes and manage your network from anywhere.

Deploy Now

Free tier available

Get the best support

Join 1660+ customers

No credit card required