Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to secure my Ubuntu PC from any threats (network/online to local/offline protection). What all can I do?

share|improve this question
up vote 6 down vote accepted

The best way to secure any computer that way is just to unplug it.

Security threats have been around and will continue to exist, and that's something you have to understand. However there are a few tips, costumization that you can do to have a more secure box.

A lot of these security measures are present in a wiki here: Ubuntu Security

Here you will find an introduction to the most famous forms of attack and how to prevent them, including:

Introduction to AppArmor

Host-based Intrusion Detection Systems (HIDS)

Network Intrusion Detection Systems (Snort)





Luckly, there are a few good resources where you can learn more:


My favorite site for security


The Big Ol' Ubuntu Security Resource

Locking Down Ubuntu

Basic info

Because there are so many measures one can take reading for those sites is a good place to start. I can resume some of the basic measures:

  1. Change SSH port or disable (if you don't need it)
  2. Set up a firewall (Firestarter - begginers, Iptables - advanced users)
  3. Disable Flash/Java
  4. Secure your home - sudo chmod 0700 /home/your-user-name
  5. Download security update packages
  6. Use strong passwords
  7. Limit root access, use sudo instead
  8. Do not install software or add repositories from untrusted sources
  9. Deny all cookies and add trusted sites, allowing only for session.
  10. Kernel and compiler hardening

Also there's an Ubuntu version called Ubuntu Server that you should try.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.