1 In KDE3 a kiosk-framework has been introduced.
3 One of the driving forces behind KDE is to put the user in control and
4 give him or her a large amount of possibilities to adjust KDE to his or her
5 liking. However, in some situations it is required to reduce the possibilities
6 of KDE, e.g. because the system is to be used for one or more specific
9 The kiosk-framework provides an easy way to disable certain features within
10 KDE to create a more controlled environment.
12 KDE's kiosk-framework builds on KDE's configuration framework and adds a
13 simple application API that applications can query to get authorisation
14 for certain operations.
16 The KDE kiosk-framework should be used IN ADDITION to the standard UNIX
19 The configuration framework in KDE3
20 ===================================
22 Since the very beginning KDE makes use of file-hierarchy to store resources
23 for its applications. Resources range from icons, wallpapers, fonts to
24 sounds, menu-descriptions and configuration files.
26 In KDE1 there were two locations were resources could be located: The
27 resources provided by the system were located under $KDEDIR and user-
28 specific resources were located under $HOME/.kde.
30 In KDE2 resource management has been largely abstracted by the introduction
31 of the KStandardDirs class and has become much more flexible. The user /
32 administrator can now specify a variable number of locations where resources
33 can be found. A list of locations can either be specified via $KDEDIRS
34 (notice the extra 'S'), via /etc/kde4rc and even via the kdeglobals config
35 file. The location where user-specific resources can be found can be
36 set with $KDEHOME (The default is $HOME/.kde). Changes made by the user
37 are always written back to $KDEHOME.
39 Both KDE1 and KDE2 feature so called "cascading configuration files": There
40 can be multiple configuration files with the same name in the various
41 locations for (config) resources, when that is the case, the information of
42 all these configuration files is combined on a key by key basis. If the same
43 key (within a certain group) is defined in more than one place, the value
44 of the key for the config file that was read last will override any previously
45 read values. Configuration files under $KDEHOME are always read last. This
46 ensures that after a configuration entry is written, the same value wil be
49 In KDE3 two important changes have been made:
51 * Default values are no longer written.
52 When a configuration file in a location other than $KDEHOME defines a value
53 for a key and the application subsequently writes out a new configuration file
54 to $KDEHOME, that configuration file will only contain an entry for the key
55 if its value differs from the value read from the other file.
57 This counters the problem that changing default configuration files under
58 $KDEDIR would not take effect for users, since these users would most likely
59 have their own copy of these settings under $KDEHOME. KDE3 will make sure
60 not to copy these settings so changes made under $KDEDIR will affect all users
61 that haven't explicitly changed the affected settings to something else.
63 * Configuration entries can be marked "immutable".
64 Starting with KDE3, configuration entries can be marked "immutable". When a
65 configuration entry is immutable it means that configuration files that are
66 read later will not be able to override its value. Immutable entries cannot
67 be changed via KConfig and if the entry is present under $KDEHOME it will
70 Entries can be marked immutable on 4 different levels:
72 - On an entry by entry basis by appending "[$i]" after the key.
78 - On a group by group basis by appending "[$i]" after the group. All entries
79 specified in the group will be marked immutable and no new entries can be
86 - On a file by file basis by starting the file with [$i].
95 - On a directory basis. [Not yet implemented]
97 - The filesystem can also be used to mark files immutable. If KDE does not
98 have write-access to the user's version of a configuration file, the file
99 will be automatically considered immutable.
101 To make the configration file of kicker (the panel) immutable one could for
102 example use the commands below.
105 chown root.root /home/user/.kde/share/config/kickerrc
106 chmod 644 /home/user/.kde/share/config/kickerrc
108 If you do this, the user will be warned that the configuration file is not
109 writable. Since you will normally not want that, you can add the following
110 two lines to the application's configuration file (or to kdeglobals to
111 disable the warning for all applications):
113 [KDE Action Restrictions]
114 warn_unwritable_config=false
116 Note that the avove example is not fool-proof, the user can potentially still
117 rename either the root-owned kickerrc file or any of the directories in
118 the path to another name and create a new kickerrc _with_ write-access.
120 KDE3 Action Restrictions
121 ========================
123 Most functionality within KDE is coupled to so called actions. For example when a user
124 selects the File->Open option in the menubar of a KDE application, the "file_open"
125 action is activated. Likewise, toolbar icons are usually also coupled to actions. KDE
126 makes it possible to disable functionality by restricting specific actions. By restricting the
127 "file_open" action for example, the corresponding entry in the menubar and the corresponding icon on
128 the toolbar, if any, will disappear.
130 To restrict access to function the kdeglobals file should contain the
131 group "[KDE Action Restrictions]", each action can then be restricted by
132 adding "<action>=false". E.g. to disable the action "shell_access" one
134 [KDE Action Restrictions][$i]
137 Actions that refer to menu and toolbar actions are prefixed with 'action/'.
138 The following standard actions are defined:
142 action/file_open_recent
148 action/file_print_preview
156 action/edit_select_all
159 action/edit_find_next
160 action/edit_find_last
162 action/view_actual_size
163 action/view_fit_to_page
164 action/view_fit_to_width
165 action/view_fit_to_height
169 action/view_redisplay
181 action/bookmarks // See note below
184 action/tools_spelling
185 action/options_show_menubar
186 action/options_show_toolbar // See note below
187 action/options_show_statusbar
188 action/options_save_options
189 action/options_configure
190 action/options_configure_keybinding
191 action/options_configure_toolbars
192 action/options_configure_notifications
193 action/help // See note below
195 action/help_whats_this
196 action/help_report_bug
197 action/help_about_app
198 action/help_about_kde
201 Actions in the KDE File Dialog:
202 action/home // Go to home directory
203 action/up // Go to parent directory
204 action/back // Go to previous directory
205 action/forward // Go to next directory
206 action/reload // Reload directory
207 action/mkdir // Create new directory
208 action/toggleSpeedbar // Show/hide sidebar
209 action/sorting menu // Sorting options
210 action/short view // Select short view
211 action/detailed view // Select detailed view
212 action/show hidden // Show/hide hidden files
213 action/preview // Show/hide preview
214 action/separate dirs // Show/hide separate directories
217 Konqueror & KDesktop related:
222 action/kdesktop_rmb // RMB menu, see note below
223 action/iconview_preview
224 action/sharefile // File sharing, see note below
225 action/sendURL // Send Link Address
226 action/sendPage // Send File
227 action/devnew // Create New -> Device
228 action/incIconSize // Increase icon size
229 action/decIconSize // Decrease icon size
230 action/go // Entire go menu
231 action/configdesktop // Configure desktop in RMB menu, see also Control Module Restrictions
232 action/executeshellcommand // In Konqueror Tools menu, see also shell_access
233 action/show_dot // Show Hidden Files, see note below
237 action/kicker_rmb // RMB menu
242 action/kwin_rmb // RMB window context menu
245 action/konsole_rmb // RMB context menu
247 action/settings // Entire settings menu
259 action/save_sessions_profile
260 action/options_configure_notifications
261 action/options_configure_keybinding
262 action/options_configure
267 action/edit_bookmarks
268 action/clear_terminal
269 action/reset_clear_terminal
275 action/clear_all_histories
276 action/detach_session
277 action/rename_session
279 action/monitor_activity
280 action/monitor_silence
281 action/send_input_to_all_sessions
286 action/move_session_left
287 action/move_session_right
288 action/previous_session
290 action/switch_to_session_1
291 action/switch_to_session_2
292 action/switch_to_session_3
293 action/switch_to_session_4
294 action/switch_to_session_5
295 action/switch_to_session_6
296 action/switch_to_session_7
297 action/switch_to_session_8
298 action/switch_to_session_9
299 action/switch_to_session_10
300 action/switch_to_session_11
301 action/switch_to_session_12
309 * action/options_show_toolbar will also disable the "Toolbars" submenu
311 * action/bookmarks also disables action/bookmark_add and action/bookmark_edit
312 * action/help is not yet fully implemented
313 * action/kdesktop_rmb disables the RMB menu but some actions may still be accesible
314 via keyboard shortcuts: cut/copy/rename/trash/delete
315 * action/iconview_preview disables the option to toggle previews on or off
316 in icon mode but the actual preview settings remains unaffected.
317 To disable previews you also need to add the following lines to
320 PreviewsEnabled[$i]=false
321 * action/show_dot disables the option to toggle showing hidden files, the actual
322 setting remains unaffected.
323 To disable showing hidden files, add the following lines to konqiconviewrc:
325 ShowDotFiles[$i]=false
326 * action/sharefile disables file sharing from the UI, but you may also want
327 to disable filesharing altogether.
330 Applications may use additional actions that they defined themselves.
331 You can get a list of the actions used by a certain applications by using the
332 following dcop command:
334 dcop <dcopid> qt objects | grep KActionCollection/ | cut -d '/' -f 3
338 dcop <dcopid> <maindwindowid> actions
341 Actions that refer to applications that need to be run as a different user
342 are prefixed by user/ and identified by the username. For example:
346 will disable all application entries that require root access.
349 Printing related action restrictions:
352 - disables the option to select the printing system (backend). It is
353 recommended to disable this option once the correct printing
354 system has been configured.
357 - disables the button to change printer properties or to add a new printer.
360 - disables the button to select additional print options.
363 - disables the panel that allows users to make more than one copy.
366 - disables the options that allows selecting a (pseudo) printer or
367 change any of the printer properties. Make sure that a proper
368 default printer has been selected before disabling this option.
369 Disabling this option also disables print/system, print/options
370 and print/properties.
373 - disables the complete print dialog. Selecting the print option will
374 immediately print the selected document using default settings.
375 Make sure that a system wide default printer has been selected.
376 No application specific settings are honored.
378 Other defined actions:
381 - defines whether a shell suitable for entering random commands
382 may be started. This also determines whether the "Run Command"
383 option (Alt-F2) can be used to run shell-commands and arbitrary
384 executables. Likewise, executables placed in the user's
385 Autostart folder will no longer be executed. Applications can
386 still be autostarted by placing .desktop files in the $KDEHOME/Autostart
387 or $KDEDIR/share/autostart directory.
388 See also run_desktop_files.
391 - defines whether the --config command line option should be honored.
392 The --config command line option can be used to circumvent
393 locked-down configuration files.
396 - defines whether the user will be able to logout from KDE.
399 - defines whether the user will be able to lock the screen.
402 - defines whether the "Run Command" (Alt-F2) option is available.
405 - define whether toolbars may be moved around by the user.
406 See also action/options_show_toolbar.
408 editable_desktop_icons
409 - define whether icons on the desktop can be moved, renamed,
410 deleted or added. You might want to set the path for
411 the Desktop to some read-only directory as well.
412 (Instead of $HOME/Desktop)
415 - defines whether users may execute desktop files that are not
416 part of the default desktop, KDE menu, registered services and
417 autostarting services.
418 * The default desktop includes the files under
419 $KDEDIR/share/kdesktop/Desktop but _NOT_ the files under
421 * The KDE menu includes all files under $KDEDIR/share/applnk and
423 * Registered services includes all files under $KDEDIR/share/services.
424 * Autostarting services include all files under $KDEDIR/share/autostart
425 but _NOT_ the files under $KDEHOME/Autostart
427 You probably also want to activate the following resource
429 "appdata_kdesktop" - To restrict the default desktop.
430 "apps" - To restrict the KDE menu.
431 "xdgdata-apps" - To restrict the KDE menu.
432 "services" - To restrict registered services.
433 "autostart" - To restrict autostarting services.
434 Otherwise users can still execute .desktop files by placing them
435 in e.g. $KDEHOME/share/kdesktop/Desktop
437 lineedit_text_completion
438 - defines whether input lines should have the potential to remember
439 any previously entered data and make suggestions based on this
440 when typing. When a single account is shared by multiple people you
441 may wish to disable this out of privacy concerns.
444 - defines whether the user may start a second X session.
445 See also the kdm configuration.
448 - defines whether user switching via kdm is allowed
451 - defines if the user may omit DRM checking.
452 Currently only used by kpdf
456 - defines whether OpenGL screensavers are allowed to be used.
458 manipulatescreen_screensavers
459 - defines whether screensavers that manipulate an image of the screen
460 (e.g. moving chunks of the screen around) are allowed to be used.
462 When configuration files are marked immutable in whole or in part the user will no
463 longer be able to make permanent changes to the settings that have been marked
464 immutable. Ideally the application will recognize this and will no longer offer the
465 user the possibility to change these settings. Unfortunately not all applications
466 support this at the moment. It's therefor possible that the user will still be
467 presented with an option in the user interface to change a setting that is
468 immutable, changes made this way will not be saved though. In some cases the
469 user may be able to use the changed setting till the application terminates, in
470 other cases the changed setting will simply be ignored and the application will
471 continue to work with the immutable setting.
473 The following applications currently detect when their configuration files have been
474 marked immutable and adjust their user interface accordingly:
476 * kicker - By marking the kickerrc config file as immutable, the panel will be
477 "locked down" and it will not be possible to make any changes to it.
479 * kdesktop - By marking the kdesktoprc config file as immutable, the desktop
480 will be "locked down" and it will no longer be possible to select
481 "Configure Desktop" from its menus.
483 * kcalc - By marking the kcalcrc config file as immutable, the "Configure" button
486 Application .desktop files can have an additional field "X-KDE-AuthorizeAction".
487 If this field is present the .desktop file is only considered if the action(s)
488 mentioned in this field has been authorized. If multiple actions are listed
489 they should be separated by commas (','). So if the .desktop file of an application
490 lists one or more actions this way and the user has no authorization for one
491 of these actions then the application will not appear in the KDE menu and will not
492 be used by KDE for opening files.
495 Changing restrictions may influence the data that is cached in the ksycoca
496 database. Since changes to .../share/config/kdeglobals do not trigger an
497 automatic ksycoca update you need to force an update manually.
498 To force an update of the ksycoca database touch the file
499 .../share/services/update_ksycoca. This will force a user's sycoca database
500 to be rebuild the next time the user logs in.
502 KDE3 URL Restrictions
503 =====================
505 It is also possible to restrict URL related actions. The restriction framework
506 can disable URL actions based on the action, the URL in question and in some cases
507 the referring URL. URLs can be matched based on protocol, host and path.
509 The syntax for adding URL action restrictions to kdeglobals is as follows:
511 [KDE URL Restrictions]
513 rule_1=<action>,<referingURL_protocol>,<referingURL_host>,<referingURL_path>,<URL_protocol>,<URL_host>,<URL_path>,<enabled>
515 rule_N=<action>,<referingURL_protocol>,<referingURL_host>,<referingURL_path>,<URL_protocol>,<URL_host>,<URL_path>,<enabled>
517 The following actions are supported:
518 redirect - e.g. a html-page obtained via HTTP could redirect itself to file:/path/some-file. This
519 is disabled by default but could be explicitly enabled for a specific HTTP host.
520 This also applies to links contained in html documents.
521 Example: rule_1=redirect,http,myhost.acme.com,,file,,,true
523 list - This controls which directories can be browsed with KDE's file-dialogs. If a user
524 should only be able to browse files under home directory one could use:
525 rule_1=list,,,,file,,,false
526 rule_2=list,,,,file,,$HOME,true
527 The first rule disables browing any directories on the local filesystem. The second rule
528 then enables browsing the users home directory.
530 open - This controls which files can be opened by the user in applications. It also
531 affects where users can save files. To only allow a user to open the files
532 in his own home directory one could use:
533 rule_1=open,,,,file,,,false
534 rule_2=open,,,,file,,$HOME,true
535 rule_3=open,,,,file,,$TMP,true
536 Note that with the above, users would still be able to open files from
537 the internet. Note that the user is also given access to $TMP in order to
538 ensure correct operation of KDE applications. $TMP is replaced with the
539 temporary directory that KDE uses for this user.
542 * empty entries match everything
543 * host names may start with a wildcard, e.g. "*.acme.com"
544 * a protocol also matches similar protocols that start with the same name,
545 e.g. "http" matches both http and https. You can use "http!" if you only want to
546 match http (and not https)
547 * specifying a path matches all URLs that start with the same path. For better results
548 you should not include a trailing slash. If you want to specify one specific path, you can
549 add an exclamation mark. E.g. "/srv" matches both "/srv" and "/srv/www" but "/srv!" only
550 matches "/srv" and not "/srv/www".
553 KDE3 Resource Restrictions
554 ==========================
555 Most KDE applications make use of additional resource files that are typically
556 located in directories under $KDEDIR/share. By default KDE allows users to
557 override any of these resources by placing files in the same location
558 under $KDEHOME/share. For example, Konsole stores profiles under
559 $KDEDIR/share/apps/konsole and users can add additional profiles by
560 installing files in $KDEHOME/share/apps/konsole.
562 KDE3 Resource Restrictions make it possible to restrict the lookup of files
563 to directories outside of $KDEHOME only.
565 The following resources are defined:
567 autostart - share/autostart
569 html - share/doc/HTML
571 config - share/config
572 pixmap - share/pixmaps
574 xdgdata-apps - share/applications
576 locale - share/locale
577 services - share/services
578 servicetypes - share/servicetypes
580 wallpaper - share/wallpapers
581 templates - share/templates
585 For the purpose of resource restrictions there are two special resources:
586 all - covers all resources
587 data_<appname> - covers the sub section for <appname> in the data resource.
589 To restrict resources the kdeglobals file should contain the
590 group "[KDE Resource Restrictions]", each resource can then be restricted by
591 adding "<resource>=false". E.g. to restrict the "wallpaper" resource to
592 $KDEDIR/share/wallpapers one would add:
593 [KDE Resource Restrictions][$i]
596 And to prevent a user from adding additional konsole profiles, one would add:
597 [KDE Resource Restrictions][$i]
601 Control Module Restrictions
602 ===========================
604 It is possible to restrict access to particular control modules.
605 Although it is possible to remove control modules from the Control
606 Center by editing the menu structure, such modules will then still
607 be available to applications. A better way is to use the control
608 module restrictions offered by KIOSK:
610 [KDE Control Module Restrictions][$i]
613 Some example menu-ids are:
617 kde-screensaver.desktop
619 See also kcmshell --list for a list of all the base names.
621 Expansion of environment variables in KDE config files.
622 =======================================================
624 In KDE3.1 arbitrary entries in configuration files can contain environment
625 variables. In order to use this the entry must be marked with [$e].
630 When the "Name" entry is read $USER will be replaced with the value of the
631 $USER environment variable. Note that the application will replace $USER
632 with the value of the environment variable after saving. To prevent this
633 combine the $e option with $i (immmutable) option.
638 The above will make that the "Name" entry will always return the value of
639 the $USER environment variable. The user will not be able to change this entry.
641 The following syntax is also supported:
645 Shell Commands in KDE config files.
646 ===================================
648 In KDE3.1 arbitrary entries in configuration files can contain shell
649 commands. This way the value of a configuration entry can be determined
650 dynamically at runtime. In order to use this the entry must be marked
657 KDE3 Kiosk Application API
658 ==========================
660 Three new methods have been added to KApplication:
662 - bool authorize(QString action); // Generic actions
663 - bool authorizeKAction(QString action); // For KActions exclusively
664 - bool authorizeURLAction(QString, referringURL, destinationURL) // URL Handling
669 Since KDE 3.4 it is possible to automatically logout users that have been idle
670 for a certain period of time.
672 WARNING: Be careful with this option, logging out a user may result in dataloss!
674 In kdesktoprc you can use the following entry to enable automatic logout:
678 AutoLogoutTimeout=600
680 The AutoLogoutTimeout is the time in seconds that the user has to be idle before
681 his session is logged out.
684 Users can be associated with Profile(s)
685 =======================================
687 A user can be associated with one or more profiles. A profile indicates a
688 configuration set that applies to a group of users. Each profile has a name
689 to identify it. If a user is associated with more than one profile then the
690 order of the two profiles is important. Settings associated with one profile
691 could override the settings in the other profile, depending on the order.
694 Mapping profiles to users
695 =========================
697 A mapping file determines which profile(s) should be used for which user.
698 The mapping file can be configured in /etc/kde4rc in the [Directories] group:
701 userProfileMapFile=/etc/kde-user-profile
703 Profiles can be mapped to individual users based on username, or profiles can
704 be mapped to groups of users based on the UNIX group(s) the users are part of.
708 Mapping profiles to individual users
709 ====================================
711 The mapping file can contain a [Users] section for mapping profiles to
712 an individual user. The [Users] section contains the user's account name
713 followed by one or more profiles as follow:
717 adrians=developer,packager
719 The above example assigns to user "bastian" the profile "developer". To user
720 "adrians" it assigns the two profiles "developer" and "packager". The order
721 in which the profiles are listed makes a difference, settings in earlier
722 profiles overrule settings in profiles that are listed after it. In the above
723 case of user "adrians", wherever the "developer" and "packager" profiles contain
724 conflicting settings, the settings of the "developer" profile will take precedent.
726 If a user has an entry under the [Users] section, this entry will determine all
727 profiles that are applicable to the user. The user will not be assigned any
728 additional profiles based on the groups the user is part of.
730 Mapping profiles to user groups
731 ===============================
733 If a user has no entry under the [Users] section in the mapping file, the profiles
734 that are applicable to the user will be based on the UNIX group(s) the user is
737 The groups and the order in which the groups are considered is determined by
738 the following entry in the [General] section of the mapping file:
741 groups=pkgs,devel,bofh
743 Each of these groups should have an entry under the [Groups] section that defines
744 which profile(s) belongs to that group. This looks as follows:
749 bofh=admin,packager,developer
751 For each group that a user is part of, the corresponding profile(s) are used. The
752 order in which the groups are listed in the "groups" entry, determines the resulting
753 order of all the applicable profiles. If multiple profiles are applicable to a
754 particular user and a profile contains settings that conflict with settings in
755 another profile then the settings in the earlier listed profile take precedent.
757 So if, based on the example above, a user is part of the "pkgs" group then the
758 "packager" profile will be used for that user. If the user is part of the "devel"
759 group then the "developer" profile will be used. Users that are part of the "bofh"
760 group will use the "admin", "packager" as well as the "developer" profile. In case
761 of conflict, settings in the "admin" profile will take precedent over settings
762 in the "packager" or "developer" profiles.
764 If the user is part of both the "pkgs" and "devel" groups, then both the "packager"
765 and "developer" profiles will be used. In case of conflicting settings between the
766 two profiles, the "packager" profile will take precedent because the "pkgs" group
767 associated with the profile was listed before the "devel" group.
769 The "groups" command can be used to see to which groups a user belongs:
772 coolo : users uucp dialout audio video cdrecording devel
774 Note that in general only a few groups will have profiles associated with them.
775 In the example above only the "devel" group has a profile associated with it,
776 the other groups do not and will be ignored.
778 If there is no profile defined for any of the groups that the user is in, the
779 user will be assigned the "default" profile.
782 The Profile determines the directory prefixes
783 =============================================
785 The global KDE configuration file (e.g. kdeglobals or /etc/kde4rc) can
786 contain config-groups that are associated with a certain user profile.
787 Such a config-group is treated similar as the [Directories] config-group.
789 The name of a such config-group is [Directories-<ProfileName>]
792 Integration with KIOSK Admin Tool
793 =================================
795 The KIOSK Admin Tool uses /etc/kde4rc as source for all its profile
796 information. For this it uses the following keys in the
797 [Directories-<ProfileName>] config-group:
799 # Short text describing this profile
802 # Files will be installed with the uid of this user
805 The KIOSK Admin Tool uses the first directory from the prefixes= entry
806 as default installation directory for this profile.
809 Default setting as example
810 ==========================
812 The following snipped could be added to /etc/kde4rc to define a "default" profile:
814 [Directories-default]
815 ProfileDescription=Default profile
816 ProfileDescription[de]=Defaultprofiel
817 ProfileInstallUser=root
818 prefixes=/var/run/kde-profile/default