How do you disable machinectl entirely? [solved]
I’m mostly interested in disabling the command to create a root shell ‘machinectl shell @root’. Attempting to ‘systemctl disable systemd-machined’ doesn’t work.
Edit:
After some more poking, it seems polkit is the way to do it. Create the file /etc/polkit-1/rules.d/10-deny-machinectl.rules and add the following
polkit.addRule(function(action, subject) {
if (action.id.startsWith("org.freedesktop.machine1.")) {
return polkit.Result.NO;
}
});
The list of all actions you can filter on are in /usr/share/polkit-1/actions/org.freedesktop.machine1.policy

![[hardware busters] The 12VHPWR connector is redesigned and renamed to 12v-2x6 (no new PSU required)](https://lemmy.ml/pictrs/image/f9a153ac-b5a7-41a3-8b01-fac50486d704.jpeg)