Official website for Linux User & Developer

Secure your Linux box with MoBlock

by Sukrit Dhandhania

MoBlock is a cutting-edge open source security tool for the Linux platform designed help fine-tune the network security of your Linux desktop or server. Sukrit Dhandhania expMoblock02lains how to use it to secure your Linux box…

Sukrit DhandhaniaAdvisor:
Sukrit has spent over seven years working with several organisations and helped them adopt GNU/Linux and other free and open source tools.

moblock (or here for Debian/Ubuntu users)

MoBlock is an open source application for the Linux platform that allows you to manage connections to and from your computer. If you have used or heard of the program PeerGuardian, MoBlock has a pretty similar function. The project caters to advanced Linux users and allows them fine-grain control over which hosts are allowed to connect to your computer and which hosts can be connected from the machine. We’ll look at how to install, configure and monitor MoBlock on your Linux machine.

01 The installation of MoBlock is pretty straightforward for users of Ubuntu Linux. Ubuntu has had MoBlock available in its package management systems for some time now. You will need to add a new set of repositories to download and install MoBlock and the other supporting tools with ‘apt-get’. As a first step, you need to add GPG keys.

For Hardy and Intrepid, type the following lines in a terminal window:

gpg –keyserver –recv 58712F29
gpg –export –armor 58712F29 | sudo apt-key add –

For Jaunty and later versions, type the following lines in the terminal window:

gpg –keyserver –recv 9C0042C8
gpg –export –armor 9C0042C8 | sudo apt-key add –

02 Now edit the ‘apt-get’ source file and add the following repository entries. Run the command ‘# sudo vim /etc/apt/sources.list’ to edit the file.

If you are running Ubuntu 9.10 (Karmic Koala), add the following lines:

deb karmic main
deb-src karmic main

For Ubuntu 9.04 (Jaunty Jackalope), instead add this:

deb jaunty main
deb-src jaunty main

For other versions, please read the instructions in the Ubuntu documentation.

Pages: 1 2 3 4
  • Tell a Friend
  • Follow our Twitter to find out about all the latest Linux news, reviews, previews, interviews, features and a whole more.
    • The great thing about moblock is it allows outgoing http so you can browse with it running(unlike pg2).

      Also go to for all the lists you’ll ever need.

    • QT

      thanks, helpful

    • CoreyB

      Doesn’t iplist do the same thing?

    • dakira

      May I suggest iplist? It is easy to install (just download and start the GUI) and use and it is not out of development.

    • I’ve been using it for over a year. It’s definitely something I’d consider an absolute must-have for any Linux set-up. When you first start using it there are a couple things to keep in-mind.

      First, if you have trouble connecting to ANYthing, check the logs to see if Moblock is the culprit (95% of the time, it is). The first thing most users will notice is that their Pidgin/Empathy/IMclientOfChoice stops working. The log will list the IP’s and info about the IP’s, so just whitelist them if need be. It’s really a very strong utility and will block pretty much everything until you tell it to do otherwise.

      Second, I love using an xterm for just about everything I do, however… Mobloquer is so amazingly good that I rarely touch MoBlock in a terminal. I’m willing to bet most users will feel the same. So, I suggest the first thing you do after installing Mobloquer is: THROW IT IN YOUR STARTUP MENU. Obviously this isn’t necessary given MoBlock starts on its own… but MOBLOQUER is a very handy thing to have hanging out in your system tray. Especially if you are trying to connect to something and failing… the startup icon serves as a geat reminder (slap to the forehead | d’oh) that, indeed, MoBlock is probably the cause.

      Again, definitely in my top-10 installs. Couldn’t be more highly recommended.

      Good writeup, Sukrit.

    • zoopster

      Oh geez…don’t bother going through all of the key adding etc when using a PPA on Launchpad.

      You are using Ubuntu 9.10, right?

      Simply use:
      sudo add-apt-repository ppa:jre-phoenix/ppa && sudo apt-get update && sudo apt-get install moblock blockcontrol mobloquer

      and you are done!

    • Daniel

      This can all be done perfectly using iptables and the hosts.deny and hosts.allow files. MoBlock is the lazy artless way of going about it.

    • Jim

      Really the lazy way. I would say the smart way. It’s like saying using a pre-built OS (ubunto or many other versions of linux) is lazy. No it is not re-inventing the wheel. It is using what has been made and then making it for you. I don’t see what is wrong with that.

    • John

      Ok Daniel, Let me point out to you where your going wrong with your logic.
      1. To create the ip tables and access control lists your way takes tons of time and wastes company money when there are many other jobs that have to be gotten done in the day. Your looking at the good ol days as the better days. Thats far from the truth. It was the costly and time consuming days. Thats why tools like this were created,to make the job easier and less costly.
      2. Your way is prone to error. Forget one thing, one careless key stroke, and your firewall configuration can become useless or error-ed. Thats not going to happen with mobloquer unless you unblock the wrong
      address in the log window or manually add a hazardous exception.
      3. Are you really going to scan the net looking for specific places to implicitly deny? Mobloquer updates dangerous site lists daily from TONS of sources. Other people do that work for you for free.
      4. Don’t you think it a bit passe’ to be an elitist Linux snob who calls people names because they have a different way of doing thing in this day in age? I have been using Linux since Red Hat 5 and I love helping people learn, use, and support Linux and never once did I ever close my mind to a better faster easier way of doing things, and would never be insulting to those that got the same exact job done better and faster. Those who get it done better and faster are the kind of people I hire in my IT department.