Turn on the firewall called 'ufw

copied from: https://sites.google.com/site/easylinuxtipsproject/mint-mate-first

1.5.1. The firewall is disabled by default, but usually it's better to turn it on. Especially on mobile devices like laptops, which sometimes connect to other networks than your own. Furthermore

The firewall is called Uncomplicated Firewall (ufw), and can be operated from the terminal.

Menu - Terminal

Copy/paste the following line into the terminal:

sudo ufw enable

Press Enter. Type your password when prompted; this will remain entirely invisible, not even asterisks will show when you type it, which is normal.

Uncomplicated Firewall (ufw) has a sensible set of default settings (profile), which are fine for the vast majority of home users. So unless you have special wishes: you're done!

You can check the status of the firewall with this command:
sudo ufw status verbose

Press Enter.

When enabled, the output should be like this:

pjotr@netbook:~$ sudo ufw status verbose
[sudo] password for pjotr:
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
pjotr@netbook:~$

I've printed the most important message in red: this output basically means that all incoming is denied and all outgoing is allowed.

There are sensible exceptions in the default settings: for example, with the default profile the use of Samba should be no problem. Also downloading torrents (fetch) should be possible; but seeding torrents (serve), might require a temporal disabling of ufw.

It's easy to disable the firewall (should you wish to do so) with this command:

sudo ufw disable

Press Enter.

If you're interested in the full set of rules, see the output of:
sudo ufw show raw

You can also read the rules files in /etc/ufw (the files whose names end with .rules).

A further explanation about the firewall and security in general, can be found here.