PinePhone Software Tweaks

From PINE64
Revision as of 10:32, 22 August 2021 by Fxc (talk | contribs) (moved from PinePhone article, author is user MikeBanon)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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