Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@damondrizzy01 damondrizzy01 commented Oct 9, 2016

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

This comment has been minimized.

Copy link

@kogent 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

This comment has been minimized.

Copy link
Owner Author

@stevejenkins stevejenkins commented Nov 27, 2016

@Dhanesh-raj

This comment has been minimized.

Copy link

@Dhanesh-raj Dhanesh-raj commented Jan 5, 2019

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
You can’t perform that action at this time.