Security
Because openUC2 OS comes with some default settings which make it less secure and easier to access for initial deployment & setup, the how-to guides here will help you override these default settings in order to:
- reduce your openUC2 OS machine's exposure to unauthorized access
- limit the potential impacts (such as ransomware attacks) of any security breaches
Connectivity
How to change the Wi-Fi hotspot's password
via Machine Administration
- Open the browser app for Machine Administration.
- Open the Internet Access page.
- In the "Wi-Fi hotspot" section, enter a new password (at least 8 characters long, and up to 63 characters long) and press the "Update and restart" button.
via the terminal
By default, the password used for connecting to the machine's Wi-Fi hotspot is youseetoo.
You should change this password to something more secure:
- Enter the machine's terminal.
- Run the following command and follow the displayed instructions in order to enter a new password (at least 8 characters long, and up to 63 characters long):
read -sp "Enter a new password: " password && echo "psk=$password" | sudo tee >/dev/null \
/etc/NetworkManager/system-connections.d/wlan0-hotspot/51-wifi-security-password.nmconnection - Apply your changes by rebooting, soft-rebooting, or running the following commands:
sudo systemctl restart \
assemble-networkmanager-connection-templated@wlan0-hotspot.service \
assemble-networkmanager-connection@wlan0-hotspot.service
sudo nmcli conn reload
Software Access
How to change the pi user's password
By default, the pi user's password is youseetoo, and it's used for:
- accessing the machine's terminal via Cockpit
- accessing the machine's terminal via SSH
- running
sudocommands in the machine's terminal
You should change this password to something more secure.
PLEASE change this password if you choose not to block access to Cockpit and to SSH over LANs!
Otherwise, anyone on the same network as your machine may be able to do anything they want to your machine by logging in as the pi user with the password youseetoo.
via Cockpit
- Open Cockpit.
- Open the "Accounts" page using Cockpit's navigation sidebar.
- Click on the "pi" username to open the page for editing the
piuser. - Click on the "Set password" button.
- Enter the
piuser's current password in the "Old password" text box, enter your desired password for thepiuser in the "New password" and "Confirm new password" boxes, and then click on the "Set password" button.
via the terminal
- Enter the machine's terminal.
- Run the command
passwdand follow the displayed instructions.
How to block access to all apps
By default, several apps are exposed over LANs. You can prevent any of those apps from being accessible by another device on a particular LAN which your machine is connected to:
over all LAN connections
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
To block access from other devices via your any LAN connection:
- Enter the machine's terminal.
- Run the command:
forklift plt --stage enable-depl-feat networking/firewalld default-zone-block - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
To undo this change:
- Run the command:
forklift plt disable-depl-feat networking/firewalld default-zone-block - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
only over a Wi-Fi connection to a LAN
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
To block access from other devices via your machine's Ethernet connection to a LAN (i.e. an external Wi-Fi network):
- Enter the machine's terminal.
- Run the command:
sudo nmcli conn modify wlan1-internet connection.zone block
To undo this change:
- Run the command:
sudo nmcli conn modify wlan1-internet connection.zone ""
only over an Ethernet connection to a LAN
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
To block access from other devices via your machine's Ethernet connection to a LAN:
- Enter the machine's terminal.
- Run the command:
forklift plt --stage enable-depl-feat networking/networkmanager/base eth0-default-firewall-block - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
To undo this change:
- Run the command:
forklift plt disable-depl-feat networking/networkmanager/base eth0-default-firewall-block - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
How to block access to specific apps over LANs
By default, several apps are exposed over LANs. You can prevent specific apps from being accessible by another device on the same LAN as your machine:
to Cockpit
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
To prevent Cockpit from being accessible by any other device on the same LAN as your machine:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat --stage admin/cockpit firewall-allow-public frontend-untrusted - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat --stage admin/cockpit firewall-allow-public frontend-untrusted - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
to SSH
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
To prevent your machine from being accessible over SSH (which exposes full administrative access to the OS) from any other device on the same LAN:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat --stage admin/sshd firewall-allow-public - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat --stage admin/sshd firewall-allow-public - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
to ImSwitch
To prevent ImSwitch (which can arbitrarily control hardware attached to the openUC2 OS machine) from being accessible by any other device on the same LAN as your machine:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat --stage imswitch frontend-untrusted firewall-allow-public - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat --stage imswitch frontend-untrusted firewall-allow-public - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
to the user file manager
To prevent the user file manager (which can download and delete data acquired by ImSwitch) from being accessible by any other device on the same LAN as your machine:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat --stage admin/filebrowser-rootfs frontend-untrusted - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat --stage admin/filebrowser-rootfs frontend-untrusted - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
How to control access to unauthenticated administrative apps
over the Wi-Fi hotspot
By default, the firewall is configured to bind the machine's Wi-Fi hotspot to firewalld's nm-shared zone for trusted networks. You can instead change the firewall to bind the Wi-Fi hotspot to the default zone, public, so that it will be treated like any other untrusted LAN:
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat networking/networkmanager/wifi-hotspot wlan0-firewall-public
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
Afterwards, access to unauthenticated administrative apps (such as the Machine Administration app, Dozzle, and the system file manager) will only be possible if you explicitly allow such access over LANs.
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat networking/networkmanager/wifi-hotspot wlan0-firewall-public
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
over direct Ethernet connections
By default, the firewall is configured to bind direct Ethernet connections to firewalld's nm-shared zone for trusted networks. You can instead change the firewall to bind Ethernet connections to the default zone, public, so that it will be treated like any other untrusted LAN:
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat networking/networkmanager/base eth0-static-firewall-public
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
Afterwards, access to unauthenticated administrative apps (such as the Machine Administration app, Dozzle, and the system file manager) will only be possible if you explicitly allow such access over LANs.
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat networking/networkmanager/base eth0-static-firewall-public
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
over USB-C
By default, the firewall is configured to bind direct USB-C networking connections to firewalld's nm-shared zone for trusted networks. You can instead change the firewall to bind USB-C networking connections to the default zone, public, so that it will be treated like any other untrusted LAN:
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat networking/networkmanager/base usb0-static-firewall-public
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
Afterwards, access to unauthenticated administrative apps (such as the Machine Administration app, Dozzle, and the system file manager) will only be possible if you explicitly allow such access over LANs.
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat networking/networkmanager/base usb0-static-firewall-public
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
over Tailscale
Before you make this change, you should ensure that you will have some way to access the machine's terminal afterwards! Otherwise, you will lock yourself out of being able to make other administrative changes to your system.
By default, the firewall is configured to bind Tailscale to firewalld's nm-shared zone for trusted networks like the machine's Wi-Fi hotspot. You can instead change the firewall to bind Tailscale to the default zone, public, so that it will be treated like any other untrusted LAN:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat networking/tailscale firewall-zone-nm-shared
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
Afterwards, access to unauthenticated administrative apps (such as the Machine Administration app, Dozzle, and the system file manager) will only be possible if you explicitly allow such access over LANs.
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat networking/tailscale firewall-zone-nm-shared
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
How to prevent Docker's port-forwarding from bypassing firewall rules
Docker containers which forward ports to 0.0.0.0/[::] (instead of forwarding ports to a particular IP address such as 127.0.0.1) will bypass all firewall rules and be accessible on all network interfaces.
To only allow a forwarded ports to be accessible (in all firewalld zones) when a port-forwarding firewall rule exists for that port (in any firewalld zone):
- Enter the machine's terminal.
- Run the command:
forklift plt enable-depl-feat networking/firewalld govern-docker-ports
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot
When any firewalld zone has port-forwarding rule to allow a Docker-forwarded port, that Docker-forwarded port will be accessible in all firewalld zones regardless of the configuration those other zones. This appears to be a consequence of how Docker implements port forwarding.
To undo your changes:
- Enter the machine's terminal.
- Run the command:
forklift plt disable-depl-feat networking/firewalld govern-docker-ports
forklift plt stage - Apply your changes by rebooting or soft-rebooting the machine, e.g. by running:
sudo systemctl soft-reboot