Installing a Firewall for Ubuntu 8.04 LTS - 9.04 and above.

Login with an Administrator account for Ubuntu.

Start Terminal by going to Applications>Accessories Terminal.

 Ubuntu Terminal command window

Type these commands in Terminal Command Prompt:

sudo ufw allow ssh/tcp

[sudo] password for USER:Your Admin. USER Password

sudo ufw logging on

sudo ufw enable

sudo ufw status

My Terminal Screen

johnson@johnson-desktop:~$ sudo ufw allow ssh/tcp

[sudo] password for johnson:

Rules updated

johnson@johnson-desktop:~$ sudo ufw logging on

Logging enabled

johnson@johnson-desktop:~$ sudo ufw enable

Firewall is active and enabled on system startup

johnson@johnson-desktop:~$ sudo ufw status

Status: active

To Action From

-- ------ ----

22/tcp ALLOW Anywhere

installing firewall in terminal prompt

Source for more information on the firewall for Ubuntu https://wiki.ubuntu.com/UbuntuFirewall