User:Mikeb/PinePhone Software Tweaks

From PINE64
Revision as of 07:27, 18 April 2023 by Mikeb (talk | contribs) (This page has been deleted without any prior warning, despite its value)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page or section is under construction

Please help to review and edit this page or section. Information are subject to change.

Linux

Network

Randomized MAC-addresses

If your PinePhone's Linux distribution uses a NetworkManager for connectivity, for the anonymity purposes it is possible to randomize the WiFi MAC address for each re-connection. Open the /etc/NetworkManager/NetworkManager.conf file with a text editor (you may need the sudo rights) - and under the existing configuration like:

[main]
dhcp=internal

add the following lines:

[device]
wifi.scan-rand-mac-address=yes
 
[connection]
wifi.cloned-mac-address=random

Autostart control

If your PinePhone's Linux distribution uses a NetworkManager for connectivity, it memorizes the last used "Enable/Disable" settings in a /var/lib/NetworkManager/NetworkManager.state file:

[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true

- and it follows them during the next boot. For security reasons, you may want to set up your PinePhone so that WiFi and Modem connections are always disabled on each boot - regardless of the last used settings! - and these connections could be manually enabled by you in Settings after boot when there's a need. To set up this, add the following lines to the NetworkManager init script just before the launch of a NetworkManager itself:

sed "s/^WirelessEnabled=true/WirelessEnabled=false/" -i /var/lib/NetworkManager/NetworkManager.state && sync
sed "s/^WWANEnabled=true/WWANEnabled=false/" -i /var/lib/NetworkManager/NetworkManager.state && sync

In example, if your PinePhone's Linux distro (i.e. postmarketOS) uses OpenRC as an init manager, open /etc/init.d/networkmanager init script and add the following section after depend() section:

start_pre() {
   sed "s/^WirelessEnabled=true/WirelessEnabled=false/" -i /var/lib/NetworkManager/NetworkManager.state && sync
   sed "s/^WWANEnabled=true/WWANEnabled=false/" -i /var/lib/NetworkManager/NetworkManager.state && sync
}


BSD

Android