The UniFI Dynamic Guest WiFi Password Changer is a PHP application designed to bolster security by regularly rotating the pre-shared key (PSK) for the guest WiFi network. Additionally, it streamlines the process for guests to connect to the WiFi network by generating a QR code containing the network's SSID and the current PSK.
- Regular PSK Rotation: The application allows administrators to schedule automatic rotation of the guest WiFi's pre-shared key at defined intervals. This helps in preventing unauthorized access and improving overall network security.
- QR Code Generation: Guests can easily connect to the WiFi network by scanning the generated QR code with their devices. The QR code contains the SSID and the current pre-shared key, eliminating the need for manual input.
- Web Interface: The application features a straightforward web interface tailored for conveniently displaying login information on a tablet within your visitor room.
- Web server with PHP support (e.g., Apache)
- PHP 7.0 or later
- "UniFI Cloud Key" or another device running the "UniFI Network" application
- Add a guest WiFi to your cloud key.
- Install Debian 12 with Apache Webserver.
- Install PHP and requipments:
sudo apt-get install php libapache2-mod-php php-imagick php-json
sudo systemctl restart apache2- Enable mod_rewrite:
sudo a2enmod rewrite
sudo systemctl restart apache2- Allow htaccess in /var/www/html:
sudo nano /etc/apache2/sites-available/000-default.confAdd the following inside the <VirtualHost *:80> block:
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
- Install git utility:
sudo apt-get install git- Clone this GIT repository to /var/www/html:
cd /var/www/html
git clone https://github.com/HerrOtto/unifi-guest-wifi-qr-code.git ./
rm -rf .git- Remove the default index.html from /var/www/html.
cd /var/www/html
rm index.html- Modify configuration and UniFI credentials in "_init.php".
sudo nano /var/www/html/_init.php- Set up a scheduled task (e.g., cron job) to run the change_psk.php script at regular intervals for automatic PSK rotation:
sudo crontab -eAdd the following line to your crontab to change the PSK every night:
0 0 * * * /usr/bin/php /var/www/html/newPSK.php
- Configure the PSK rotation interval according to your security needs by changing crontab.
- Add "http://debian-webserver-ip/" to your tablet's start page using a kiosk browser.
This application is provided as-is without any warranties. Use at your own risk. The developers are not responsible for any security breaches or other issues that may arise from the use of this application.
This application is licensed under the MIT License