Ubiquti USG unifi security gateway adopt settings via ssh cli command line for parental control purposes

Login to your USG/unifi security gateway via ssh secure shell port 22 with putty on windows or ssh shell on your favourite  *nix derivate.

Destination ip address should be 192.168.1.1 in case you not changed the default.

Credentials:

In case you haven't installed and setup the unifi controller for the USG until now:

https://help.ubnt.com/hc/en-us/articles/204909374-UniFi-Default-Username-and-Password

Otherwise:

Use the credentials as seen due the installation of the unifi controller.

You can't use the credentials for the unifi controller UI/user interface. During the installation process there was displayed a 2nd set of credentials, default user name in this dialog was "admin" - password was obfuscated by asterik signs. This is the right one.

Once you are logged in type

configure

You are now a in a subshell and enabled to configure the USG via the cli (command line interface) level

do your changes, e.g.

set firewall name Parental-Control rule 10000 description "Block teenager based on time."
set firewall name Parental-Control rule 10000 action drop
set firewall name Parental-Control rule 10000 time  starttime 20:00:00
set firewall name Parental-Control rule 10000 time stoptime 11:00:00
set firewall name Parental-Control rule 10000 time weekdays Mon,Tue,Wed,Thu
set interfaces ethernet eth1 vif 30 firewall in name Time

to apply these settings type

commit; save ; exit

Cross your fingers and know what you're doing.

Otherwise type

exit discard

To take effect reboot the USG.

This worked for me, no guarantees it works for you.

The file that will get modified in this procedure is 

/config/config.boot

So it's sound like a good idea to get a backup of it via scp before applying any settings.

Disclaimer: Try it at your own risk, understand what i wrote and be aware that you can brick your device due such settings. And again, backup the file mentioned above. Good luck.

Comments

Popular Posts