I want to secure my Ubuntu PC from any threats (network/online to local/offline protection). What all can I do?
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)
SSH and VNC
Luckly, there are a few good resources where you can learn more:
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:
- Change SSH port or disable (if you don't need it)
- Set up a firewall (Firestarter - begginers, Iptables - advanced users)
- Disable Flash/Java
- Secure your home -
sudo chmod 0700 /home/your-user-name
- Download security update packages
- Use strong passwords
- Limit root access, use sudo instead
- Do not install software or add repositories from untrusted sources
- Deny all cookies and add trusted sites, allowing only for session.
- Kernel and compiler hardening
Also there's an Ubuntu version called Ubuntu Server that you should try.