Skip to content

Instantly share code, notes, and snippets.

@stevejenkins
Last active July 7, 2021 19:51
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save stevejenkins/0c2687936f31cd0deda1 to your computer and use it in GitHub Desktop.
Save stevejenkins/0c2687936f31cd0deda1 to your computer and use it in GitHub Desktop.
Simple shell script to remotely reboot a Ubiquiti UBNT UniFi Access Point (UAP, UAP-PRO, UAP-AC, etc.)
#MOVED TO: https://github.com/stevejenkins/unifi-linux-utils
@damondrizzy01
Copy link

Hi Steve,
Found this very helpful.
How can i use this script to reboot up to 20 Ap's. Do i just add all ip's or i need to modify some things as i am new to scripting and linux.

Thanks.

@kogent
Copy link

kogent commented Oct 17, 2016

Using askpass and disabling hostkey checking is insecure by nature.

Since it is supported out of the box, you should consider using public key authentication for passwordless access.

ssh passwords are much easier to brute force than keys or if someone sets up an account to make this script work as is, the device is easily compromised.

Hostkeys should be enforced and updating them on a different audit-able cycle from this script should be considered if security is a concern. To do that from the command line you can use ssh-keyscan to collect relevant hostkeys. ssh-keygen -R can be used to delete a hostkey programmatically if you find one that needs to be updated.

Hostkeys make sure that the remote device is the device you expect it to be. If the key changes and you had not done anything to cause the change, you should treat it as a rogue device.

@stevejenkins
Copy link
Author

@Dhanesh-raj
Copy link

Can I reboot Ubiquiti Nanostation M2 using this script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment