Skip to content

Commit 7ce083f

Browse files
committed
allow user to manage nmcli/nmtui from the command line
1 parent e63ee01 commit 7ce083f

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

malcolm-iso/config/hooks/normal/0991-security-performance.hook.chroot

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,25 @@ net.ipv6.conf.default.disable_ipv6=1
9595
net.ipv6.conf.lo.disable_ipv6=1
9696
EOF
9797

98+
mkdir -p /etc/polkit-1/rules.d/
99+
cat << 'EOF' > /etc/polkit-1/rules.d/50-networkmanager-netdev.rules
100+
polkit.addRule(function(action, subject) {
101+
if (subject.isInGroup("netdev")) {
102+
if (
103+
action.id == "org.freedesktop.NetworkManager.network-control" ||
104+
action.id == "org.freedesktop.NetworkManager.settings.modify.system" ||
105+
action.id == "org.freedesktop.NetworkManager.settings.modify.own" ||
106+
action.id == "org.freedesktop.NetworkManager.enable-disable-network" ||
107+
action.id == "org.freedesktop.NetworkManager.enable-disable-wifi"
108+
) {
109+
return polkit.Result.YES;
110+
}
111+
}
112+
});
113+
EOF
114+
chmod 755 /etc/polkit-1/rules.d/
115+
chmod 644 /etc/polkit-1/rules.d/50-networkmanager-netdev.rules
116+
98117
# password requirement hardening
99118
sed -i -e 's/[[:space:]]*nullok[[:alnum:]_]*//g' /etc/pam.d/common-auth
100119
sed -i -r "s/(pam_faildelay.so.*delay)[[:space:]]*=[[:space:]]*[[:digit:]]+/\1=4000000/g" /etc/pam.d/login

0 commit comments

Comments
 (0)