3

I'm administering a system and do not want people messing with their system settings (specifically the power settings).

I've searched everywhere and cannot find a method for disabling the power settings from system settings.

The gnome-system-tools package didn't contain any options for restricting access to system settings or power settings.

Using Raring Ringtail.

1
  • I would assume that the ability for non-privileged users to modify system settings is granted by policykit actions, but I am not certain this applies to things like power settings. Jun 13, 2013 at 10:30

5 Answers 5

5

Changing permissions to 700 for /usr/bin/gnome-control-center would help you restrict the normal users gain access.
However that goes out for all the settings, and users wont be able to set other settings like the display or keyboard.

Another good way is to define user group and change the ownership of gnome-control-center to those groups. and then add the permissible user to the group. the full description is here.

We have done is created groups with certain admin privileges and managed centrally using/etc/sudoers where in entries are whitelisted and provided on need basis.
For example:
Including the line :

$admin=ALL=(ALL) ALL `!/usr/bin/gnome-control-center`
2
  • 3
    Note that clever users will still be able to use other tools to change their settings. With gsettings, for example. If you restrict access to that, then users will be able to do what gsettings does, ad infinitum. So this method does work, but only for users who don't know how to get around it. Jun 13, 2013 at 11:24
  • @RobieBasak That is absolutely correct, however here we are trying to avoid users making stupid mistakes. Anyone with an intent will surely be able to change what he wants.
    – karan
    Jun 13, 2013 at 11:29
0

Gnome Control Center loads all of the applets that have .desktop files in /usr/share/applications. It does not complain if some applets are missing.

Once you have the settings you need in place, the easiest way to keep the applet from showing in the Control Center is to just rename the corresponding .desktop file.

sudo mv /usr/share/applications/gnome-power-panel.desktop /usr/share/applications/gnome-power-panel.desktop.original

This will also prevent users from running the applet in isolation since the renamed file will not show up in Dash searches.

2
  • I get a file not found. Where is gnome-power-panel located?
    – dukevin
    Jun 13, 2013 at 19:07
  • 1
    @kevin-duke Sorry, I had mentioned the location /usr/share/applications above, but since I normally cd to a folder before running these kind of commands, I forgot to include it in the command. I added it to the answer.
    – chaskes
    Jun 13, 2013 at 19:18
0
sudo chgrp adm /usr/bin/unity-control-center
sudo chmod 750 /usr/bin/unity-control-center

These commands worked for me.

1
  • 1
    I recommend to edit this answer to expand it with specific details about what this command does. A plain command or command sequence is rarely considered an answer. (See also How do I write a good answer? for general advice about what sorts of answers are considered most valuable on Ask Ubuntu.) Apr 5, 2018 at 21:14
-1

If you want to forbit an user or a group to open the system-control-panel then edit /usr/bin/gnome-control-center

Here is an example (User 'user' may not start center):

#!/bin/sh

# User 'user' may not start the systemsettings
if [ $USER = "user" ]; then
    exit 1;
fi

# from here on is the original file!
#
# Support legacy applications that still refer to gnome-control-center in Unity
if [ "$XDG_CURRENT_DESKTOP" = "Unity" ] && [ -x /usr/bin/unity-control-center ]; then
  exec /usr/bin/unity-control-center $@
else
  exec /usr/bin/gnome-control-center.real $@
fi
# End of file`
1
  • This is trivial to bypass. For example, a user can simply run unity-control-center or gnome-control-center.real; or they can make their own script, either by copying this one and modifying it or by downloading or rewriting the original; or they can set the USER environment variable to a different value when they run the script (USER=whatever gnome-control-center). This does not prevent users from accessing System Settings in any way. ...In defense of this answer (sort of), the other answers posted here are not very effective, either. Apr 3, 2018 at 22:39
-2

You could install

ninja

and there configure a "blacklist", which programs should be not for general use.

2
  • This seems really inefficient for such a simple task even windows 2000 has. Is there really no other way?
    – dukevin
    Jun 13, 2013 at 10:10
  • Why voting me down ?! I am NOT kidding you ! ninja is a full-featured Linux tool ! Nothing to do with Windows. You can read more here: blog.bodhizazen.net/linux/how-to-ninja-ubuntu-10-04 Jun 13, 2013 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .