Afterward make these changes should I still install a firewall in my Ubuntu?

September 24, 2015 773 views
Security Firewall Ubuntu

The changes I done:

  1. Disable Root Login
  2. Disable Authentication Password
  3. Change port number SSH
  4. Enable login through SSH Key private/public

Should I install some firewall to protect more my Ubuntu 14.04?
What is the best firewall?

2 Answers

If you have ubuntu installed, then you already have a firewall installed because ubuntu includes UFW (uncomplicated firewall). You just need to enable it for the ports you are using... here are the commands for some of the more common ports as examples...

sudo ufw allow ssh (instructs firewall to allow port 22 ssh connections)
sudo ufw allow 80/tcp (instructs firewall to allow port 80 http connections)
sudo ufw allow 443/tcp (instructs firewall to allow port 443 https connections)
sudo ufw allow 25/tcp (instructs firewall to allow port 25 smtp connections)
sudo ufw show added (instructs firewall to show added connections)
sudo ufw enable (enables firewall)

Hope that helps :)

Good luck!

You could ofcourse increase your server security. For example you could use:

  • Clamav - freshclam
  • Rkhunter
  • Fail2ban

And you could ofcourse use IPTables to setup a nice secure system. For example, I've setup IPTables to only allow incoming connections on important ports (ssh,ftp etc.) from my IP adress and block all other. That makes it alot more secure as well, you could ofcourse think of other ideas.

Have another answer? Share your knowledge.