Questo contenuto non è disponibile nella lingua selezionata.
Chapter 20. Locking down selected tasks
This section describes how to lock down for users the following tasks:
- Printing
- File saving on disk
- Repartitioning
- User logout and user switching
20.1. Locking down printing Copia collegamentoCollegamento copiato negli appunti!
You can disable the print dialog from being shown to users. This can be useful if you are giving temporary access to a user or you do not want the user to print to network printers.
The feature only works in applications which support it. Not all GNOME and third party applications have this feature enabled. The changes do not have effect on applications which do not support this feature.
To prevent applications from printing, lock down the org.gnome.desktop.lockdown.disable-printing key:
Procedure
Create the user profile in
/etc/dconf/profile/userunless it already exists:user-db:user system-db:local
user-db:user system-db:localCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a local database for machine-wide settings in the
etc/dconf/db/local.d/00-lockdownfile:[org/gnome/desktop/lockdown] # Prevent applications from printing disable-printing=true
[org/gnome/desktop/lockdown] # Prevent applications from printing disable-printing=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Override the user’s setting and prevent the user from changing it in the
/etc/dconf/db/local.d/locks/lockdownfile:List the keys used to configure lockdown
# List the keys used to configure lockdown /org/gnome/desktop/lockdown/disable-printingCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Having followed these steps, applications supporting this lockdown key, such as Evolution, Evince, or Gedit, will disable printing.
20.2. Locking file saving on disk Copia collegamentoCollegamento copiato negli appunti!
You can disable the Save and Save As dialogs. This can be useful if you are giving temporary access to a user or you do not want the user to save files to the computer.
The feature only works in applications which support it. Not all GNOME and third party applications have this feature enabled. The changes will have no effect on applications which do not support this feature.
To prevent applications from file saving, lock down the org.gnome.desktop.lockdown.disable-save-to-disk key:
Procedure
Create the user profile in
/etc/dconf/profile/userunless it already exists:user-db:user system-db:local
user-db:user system-db:localCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a local database for machine-wide settings in the
/etc/dconf/db/local.d/00-lockdownfile:[org/gnome/desktop/lockdown] # Prevent the user from saving files on disk disable-save-to-disk=true
[org/gnome/desktop/lockdown] # Prevent the user from saving files on disk disable-save-to-disk=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Override the user’s setting and prevent the user from changing it in the
/etc/dconf/db/local.d/locks/lockdownfile:Lock this key to disable saving files on disk
# Lock this key to disable saving files on disk /org/gnome/desktop/lockdown/disable-save-to-diskCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Having followed these steps, applications supporting this lockdown key, for example Videos, Image Viewer, Evolution, Document Viewer, or GNOME Shell, will disable their Save As dialogs.
20.3. Locking repartitioning Copia collegamentoCollegamento copiato negli appunti!
polkit enables you to set permissions for individual operations. For udisks2, the utility for disk management services, the configuration is located at /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy. This file contains a set of actions and default values, which can be overridden by system administrator.
polkit configuration stored in /etc overrides the configuration shipped by packages in /usr/share/.
Procedure
Create a file with the same content as in
/usr/share/polkit-1/actions/org.freedesktop.udisks2.policy:cp /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy /etc/share/polkit-1/actions/org.freedesktop.udisks2.policy
cp /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy /etc/share/polkit-1/actions/org.freedesktop.udisks2.policyCopy to Clipboard Copied! Toggle word wrap Toggle overflow Do not change the
/usr/share/polkit-1/actions/org.freedesktop.udisks2.policyfile, your changes will be overwritten by the next package update.Delete the action you do not need, and add the following lines to the
/etc/polkit-1/actions/org.freedesktop.udisks2.policyfile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
nobyauth_adminif you want to ensure only therootuser is able to perform the action.- Save the changes.
When the user tries to change the disks settings, the following message is returned:
Authentication is required to modify the disks settings.
Authentication is required to modify the disks settings.
20.4. Locking down user logout and user switching Copia collegamentoCollegamento copiato negli appunti!
To prevent the user from logging out, use the following procedure.
Procedure
Create the
/etc/dconf/profile/userprofile, which contains the following lines:user-db:user system-db:local
user-db:user system-db:localCopy to Clipboard Copied! Toggle word wrap Toggle overflow where
localis the name of a dconf database-
Create the
/etc/dconf/db/local.d/directory if it does not already exist. Create the
/etc/dconf/db/local.d/00-logoutkey file to provide information for the local database:[org/gnome/desktop/lockdown] # Prevent the user from user switching disable-log-out=true
[org/gnome/desktop/lockdown] # Prevent the user from user switching disable-log-out=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Override the user’s setting, and prevent the user from changing it in the
/etc/dconf/db/local.d/locks/lockdownfile:Lock this key to disable user logout
# Lock this key to disable user logout /org/gnome/desktop/lockdown/disable-log-outCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Users must log out and back in again before the system-wide settings take effect.
Users can evade the logout lockdown by switching to a different user. To prevent such scenario, lock down user switching as well.
To lock down user switching, use the following procedure:
Procedure
Create the
/etc/dconf/profile/userprofile, which contains the following lines:user-db:user system-db:local
user-db:user system-db:localCopy to Clipboard Copied! Toggle word wrap Toggle overflow where
localis the name of a dconf database-
Create the
/etc/dconf/db/local.d/directory if it does not already exist. Create the
/etc/dconf/db/local.d/00-user-switchingkey file to provide information for the local database:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Override the user’s setting, and prevent the user from changing it in the
/etc/dconf/db/local.d/locks/lockdownfile:Lock this key to disable user switching
# Lock this key to disable user switching /org/gnome/desktop/lockdown/disable-user-switching /org/gnome/desktop/screensaver/user-switch-enabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Users must log out and back in again before the system-wide settings take effect.