Following are some Ubuntu Linux safety recommendations for a number of totally different use circumstances. Whether or not you’re an informal desktop consumer, a programmer, or a Linux energy consumer, there are straightforward to implement safety measures that can assist safeguard your system.
Why Securing Your Ubuntu Set up Is Vital
Ubuntu is without doubt one of the hottest Linux distributions on account of its ease of use and robust security measures. Nonetheless, no working system is fully safe out of the field. Threats reminiscent of malware, unauthorized entry, and knowledge breaches can goal even informal customers. Whether or not you are utilizing Ubuntu for private duties, work, or improvement, taking primary safety precautions helps shield your system and knowledge.
The excellent news is that you just don’t must be a tech knowledgeable to enhance your safety. Easy steps like maintaining your system up to date and enabling a firewall can go a good distance in safeguarding your Ubuntu set up.
Hold Your System Up to date
One of many best and simplest methods to safe your Ubuntu system is by maintaining it up to date. Updates not solely introduce new options but in addition patch safety vulnerabilities that attackers would possibly exploit. Neglecting updates can go away your system open to identified safety threats. That is beneficial for all customers.
The best way to Replace Ubuntu through Terminal
Ubuntu gives a easy option to replace your system utilizing the terminal. Open a terminal window and run the next command:
sudo apt replace && sudo apt improve -y
“apt replace” refreshes the package deal listing to verify for brand spanking new updates, “apt improve” installs obtainable updates, and the “-y” change will routinely reply sure to any improve affirmation questions.
Allow Automated Safety Updates
To make sure your system stays safe with out guide intervention, you’ll be able to allow unattended safety updates:
Set up the unattended-upgrades package deal if it’s not already put in and run the configuration program:
sudo apt set up unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
This setting permits safety updates to be put in routinely within the background, decreasing your threat of lacking essential and pressing patches.
Create a Stronger Consumer Password & Allow 2FA
A weak password is without doubt one of the best methods for an attacker to compromise your system. Use a protracted, distinctive password that’s at the very least 12 characters lengthy with a mixture of letters, numbers, and particular characters. Consider using a password manager to generate and retailer safe passwords.
Setting Up Two-Issue Authentication (2FA)
Two-Issue Authentication (2FA) provides an additional layer of safety by requiring a secondary verification step (reminiscent of a code from an authenticator app) along with your password. You’ll be able to set up the Google Authenticator package deal and arrange 2FA by issuing the next instructions in a terminal.
sudo apt set up libpam-google-authenticator
google-authenticator
For a whole walkthrough of the setup course of, verify our article on how to set up 2FA for your Ubuntu user account.
Set Up a Firewall, Builders & Tinkerers
If you happen to’re operating Ubuntu as a developer otherwise you’re the kind that enjoys experimenting with networked functions, you could open ports unknowingly, exposing your system to exterior threats. A firewall helps maintain incoming and outgoing community site visitors beneath management, even when a program you’ve put in tries to do one thing out of the abnormal.
By default UFW permits outgoing site visitors and blocks all incoming site visitors that’s not a part of a response to some outgoing request. For instance, when you go to an online web page, the firewall will let the response(s) from the online server by. Nonetheless, if some entity tries to hook up with port 356 out of nowhere, that connection might be denied.
Allow and Configure UFW (Uncomplicated Firewall)
UFW is a user-friendly firewall that comes pre-installed on Ubuntu. To allow it, run:
sudo ufw allow
To permit SSH entry (if wanted) for example:
sudo ufw restrict 22/tcp remark 'SSH port'
To verify the standing of UFW and see energetic guidelines:
sudo ufw standing verbose
For extra superior configurations, consult with the official UFW assist web page:
man ufw
Gentle Consumer? Disable Pointless Providers
Working pointless companies will increase your assault floor, which means there are extra potential entry factors for attackers. Particularly when you’re a lightweight consumer, and you utilize your system primarily for issues like shopping the online and electronic mail, there are in all probability a number of companies operating that you just by no means use and do not want. Disabling these will enhance the safety of your system in addition to unlock system sources for different duties.
You’ll be able to list all services currently running on your system with the next command:
systemctl listing-units --type=service
If you happen to acknowledge companies that you just don’t use or want, you’ll be able to cease and disable them simply. For instance, to disable GNOME distant desktop entry:
sudo systemctl cease gnome-remote-desktop
sudo systemctl disable gnome-remote-desktop
This ensures that the distant desktop service doesn’t begin routinely on boot, decreasing the danger of unauthorized distant entry.
While you cease a service, you need to use your system for at the very least a couple of minutes earlier than persevering with and fully disabling that service. If issues happen, you’ll be able to reboot and the service will come again on-line. If you happen to cease and disable a essential service, you could possibly render your system unbootable. You shouldn’t disable any service that you’re not sure of.

Associated
Allow AppArmor for Software Safety When Exploring Software program
AppArmor is a Linux safety module that restricts the capabilities of functions to attenuate safety dangers. It’s usually enabled by default on Ubuntu however needs to be checked to make sure it’s energetic.
To confirm if AppArmor is operating:
sudo apparmor_status
It is best to get output just like the next screenshot:
If AppArmor is inactive, you’ll be able to allow it by operating:
sudo systemctl allow apparmor
sudo systemctl begin apparmor
For superior customers, AppArmor profiles could be configured to provide you extra fine-grained management over utility permissions. You will discover extra data profiles and different settings within the AppArmor man page:
man apparmor
Securing your Ubuntu system doesn’t must be difficult. Even primary steps, reminiscent of maintaining your system up to date and enabling a firewall, considerably scale back safety dangers. Extra superior customers can additional improve their safety by utilizing robust passwords, establishing 2FA, disabling pointless companies, and configuring AppArmor. It solely takes a couple of minutes to implement any or all the recommendations above. By taking these easy precautions, you’ll be able to guarantee your Ubuntu system stays protected from common cyber threats.

Associated
10 Security Tips Your IT Department Wishes You’d Follow
Your work should not comply with you dwelling, however good on-line safety practices ought to.