I am using Veyon (client computers control software in local network) software on Pardus 23.2 (based debian 12). The network connection must be open for this program to work. However, some students turn off the network connection. How can I prevent this?
1 Answer
I don't have a copy of this OS to test changes in that exact environment, but there are a couple different paths you can take to restrict the ability of non-admin users to change network in Debian.
Based on this answer, you can use PolicyKit to prevent users from modifying the network state and connections. Change the group as appropriate, via a file like /etc/polkit-1/rules.d/98-manage-students.rules with polkit:
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.NetworkManager") == 0 &&
subject.isInGroup("students")) {
return polkit.Result.NO;
}
});
You can also turn on autoconnect for the specific interface with NetworkManager, as demonstrated in this answer:
nmcli device set IFNAME autoconnect yes
Of course, at the end of the day, if it's a wired connection the user can always just unplug the cable.