[[privileges]]= Privileges and PermissionsWhen a user is logged into Cockpit, they are logged into a normalsession that has exactly the same privileges as if they logged in viaSSH or on the console.However, Cockpit will usually try to escalate the privileges of the userusing https://www.freedesktop.org/wiki/Software/polkit/[Policy Kit] orhttps://www.sudo.ws/[sudo]. If the user is able to escalate privilegesfrom the command line by typing in their password again (or withouttyping in any password), then Cockpit will be able to escalate theprivileges of the session to "root" immediately upon login.The user can change the privileges of a session from within thatsession, via the "Administrative access" indicator in the top bar. Fromthat indicator, the user can drop "root" privileges and regain them. Onthe next login, Cockpit will give the session the same privileges.Usually a user needs to be in the `+wheel+` Unix user group for the userto be able to escalate privileges in this way. However both Policy Kitand sudo may be configured to use other criteria.[[privileges-polkit]]== Customizing Polkit PrivilegesServices likehttps://www.freedesktop.org/wiki/Software/systemd/[systemd] andhttps://wiki.gnome.org/Projects/NetworkManager[NetworkManager] usehttps://www.freedesktop.org/wiki/Software/polkit/[Polkit] to validateand escalate privileges. It is possible to customize these rules withfiles in `+/etc/polkit-1/rules.d+`.Polkit rules files arehttps://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html[javascriptwith specific methods and objects]. For example, placing the followingpolkit rule to `+/etc/polkit-1/rules.d/10-operators.rule+` allows allusers in the `+operators+` group to start, stop, restart and otherwisemanage systemd services:....polkit.addRule(function(action, subject) {if (action.id == "org.freedesktop.systemd1.manage-units") {if (subject.isInGroup("operators")) {return polkit.Result.YES;}}});....In order to allow a certain group to perform any administrative actionyou could add a rule like this:....polkit.addAdminRule(function(action, subject) {return ["unix-group:operators"];});....