HOWTO Lockdown Mozilla Preferences for LTSP
Hits:16410
Version
0.1
Copyright 2004 Warren Togami <warren@togami.com>
Table
of Contents
- Introduction
- Revision History
- Downloads
- Quick Instructions
- Mozilla Options
- Conclusion
- Links to More Resources
1. Introduction
This short guide explains how you can
lockdown Mozilla preferences for all users on Linux system to options
which you define. Locking down of Mozilla preferences can be
useful in public kiosks, school, university or business computers where
you want certain options (like a standard homepage) set and you do not
want users to be able to modify it.
This particular document was put together to be a succinct and quick
example of locking down preferences to be suitable for a
K12LTSP school
environment. See the Links to More Resources at the end of this
document to more advanced details of Mozilla and Netscape default
preference setting & locking.
These directions were last tested on Fedora Core with mozilla-1.6 and
firefox-0.8, but would probably work with other recent versions of Mozilla
and other brands of Linux.
2.
Revision History
Version 0.2 - February 25, 2004
* Include sample for Firefox 0.8
* Fix mozilla.cfg path in pref/all.js because it no longer works in
mozilla-1.6 and firefox-0.8
Version 0.1 - September 14, 2003
* Initial Release
3.
Downloads
Download these two files, then read
Instructions in the next section.
moz-byteshift.pl - Perl script to
byteshift a file, necessary for encoding the Mozilla .cfg file.
mozilla.js - Example configuration file.
You will want to edit it, or create your own.
firefox.js - Example configuration for Firefox
0.8.
4.
Quick Instructions
- Save moz-byteshift.pl
into /usr/local/bin
- chmod 755
/usr/local/bin/moz-byteshift.pl
This step makes the script executable.
- Copy mozilla.js into the
home directory of your Mozilla browser. Scripts call this
directory MOZILLA_FIVE_HOME. This is where you will find the
browser executables, default preferences and more.
- Example locations are /usr/lib/mozilla-1.6 for Mozilla 1.6, or
/usr/lib/firefox for Firefox 0.8 from Fedora.
- Note that it really does not matter what you call this
file. I personally use firefox.js for Firefox.
- Edit mozilla.js to
suit your needs. Read the next section Mozilla Options to learn
what other options are available.
- moz-byteshift.pl -s 13 <
mozilla.js > mozilla.cfg
This encodes the contents of mozilla.js into mozilla.cfg. It
seems incredibly illogical and without any technical reason why it was
designed this way, but it needs to be done. Repeat this step
every time you edit mozilla.js so the changes will exist within
mozilla.cfg.
- Again, it is unimportant what this file is called.
- It is important that the .cfg
file be in the MOZILLA_FIVE_HOME directory mentioned in step #3.
- Edit /usr/lib/mozilla-VERSION/defaults/pref/all.js
substituting VERSION with the actual directory name
Add the following line at the bottom:
pref("general.config.filename",
"mozilla.cfg");
5.
Mozilla Options
It is beyond the scope of the document to describe all possible
Mozilla options that can be set or locked in mozilla.js, though unfortunately
this is currently a poorly
documented section of Mozilla's site. Please see Mozilla's
Documentation on the subject of preferences. Otherwise this
following method of capturing the preferences never fails.
- Close Mozilla.
- Go into ~/.mozilla/default/XXXXXXXXXX.slt and make a backup copy
of prefs.js in another directory.
cp prefs.js ~/
- Open Mozilla and configure preferences using the GUI menus.
- Close Mozilla so those preferences are saved to the files.
- Go back into the directory in #2 above, then compare the
difference between the old and new configuration file using:
diff -u ~/prefs.js prefs.js
- Place options into mozilla.js
using the existing options for syntax examples. You may
need to do some editing of options, and unfortunately some options
cannot be included like browser.cache.disk.parent_directory
because it points to a user specific directory.
6.
Conclusion
At this point whenever any user runs
Mozilla, it should use the options that you have specified in
mozilla.js, and will be locked from user changes. Do not forget
to rerun moz-byteshift.pl after you edit mozilla.js, or the changes
cannot be seen by Mozilla.
7.
Links to More Resources
- seul-edu:
Locking Down Mozilla or Phoenix
This was perhaps the most useful information in figuring out the
lockdown procedure.
- Mozilla.org was completely not useful in figuring out how to do
this. Please fix this situation!