Lock Firefox 6 Prefs (Also versions 3, 4, & 5)
In a corporate environment, it's often important to enforce Internet proxy settings for all users. Setting those options automatically is often difficult. Making them locked and immutable is even more difficult and poorly documented. Today we'll learn the basics, and from there you can customize Firefox as much or as little as you like.
The first thing to understand is how Firefox preferences work. In your browser, type the address "about:config" and press enter. After agreeing to their warning message, you should see a whole list of configuration options listed with their current settings. These settings are for your user only, but it should help you get the notion for just how many settings are possible to set.
If you're comfortable with the command line, the steps we're going to go over are quicker and easier with a terminal window, but we're going to show the GUI way so as not to exclude anyone. (If you are comfortable on the command line, you'll know how to follow the directions below without any problems)
I'm using Ubuntu 11.04 for this demonstration, but most distributions have similar setups. You might have to search a little for where preference files are stored, but the procedure will be similar. First we need to open a Nautilus window with superuser privileges. To do that, press ALT-F2, then type:
gksudo nautilus and press enter.
Next we need to navigate the file system to the
/etc/firefox directory. Depending on your version of Firefox, and your distribution, this folder and its contents might vary a bit. This is what it looks like with Ubuntu 11.04 and Firefox 6:
The file we want to edit is that
syspref.js file. This file might not be here for different versions, in which case you can try editing whatever .js file you find. Also files inside the pref folder are usually parsed, so you could create a .js file in there and it will probably work. Unfortunately, you'll just need to try it and see if it works.
Double click on the file, and it should open (with superuser privileges) in a text editor. You'll see this file was designed for adding custom preferences. Unfortunately, you can't lock preferences in here. Anything added to this file will be the default for new users, but you can't lock any preferences for all users. What we'll do is add a directive for another config file. In that one, we can lock prefs. You'll want to add the following to the bottom of the
Here's what my file looks like:
Close that window and save the file. Next we need to make the
firefox.cfg file we referenced. It would make sense that we'd put the file in the same folder, but sadly that's not the case. The file
firefox.cfg with our locked preference settings needs to go in the
/usr/lib/firefox-$VERSION/ folder. We need to replace $VERSION with the currently installed version of Firefox. That's where it gets a little confusing. If Firefox gets updated, we have to remember to move the firefox.cfg file to the new
firefox-$VERSION folder. To do that, look in
/usr/lib for the firefox folders that exist, and pick your current version. Here I've highlighted my current version, which is
Once inside that folder, we need to create the lock file, which must be named whatever we called it back in the syspref.js file. In our case, we need to create a file called firefox.cfg.
Make sure to name the file "firefox.cfg" when you create it. Then double-click on the file, and we'll add our custom configuration. The preferences I'm most concerned with are Homepage Settings and Proxy Settings. Here's what goes into my firefox.cfg:
// Lock specific preferences in Firefox so that users cannot edit them
lockPref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, 192.168.1.0/24");
Note the lockPref directive. It differs from what we put in the syspref.js file, and as you'd expect, it locks the given preference. Here's what it looks like on my system:
All that is left is to save that file, and close the Nautilus window. (Remember, you're running Nautilus as root -- that's not something you want to do willy nilly) Now, when users start Firefox, it will use the preferences you set, regardless of any setting they might have already set. For example, if a user tries to edit the proxy settings on my system, the fields I specified are not even available to change!
Hopefully this tutorial can be adapted to meet your Firefox needs. The ability to lock preferences is vital in a large network. I wish the procedure was better documented, but at least it's possible. Have fun!
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- The Firebird Project's Firebird Relational Database
- Stunnel Security for Oracle
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide