Find code and diagrams at:

UFW is a simple firewall application that is included with Ubuntu nd can be installed on other distributions of Linux.

Note: For the demonstrations to work you may need to change settings or hardware configurations within your virtualization software. I had to connect my host machine to a hard word connection for Rules for specific IP Addresses to work.

sudo ufw status – shows current status of ufw
sudo ufw enable – Enables ufw firewall
By default ALL incoming traffic is blocked
sudo ufw disable – Disables ufw
sudo ufw status verbose – Shows all Rules currently configured for ufw
sudo ufw allow 21 – Allows specific port
sudo ufw allow ssh – Allows ports for a specific service
sudo ufw status numbered – Shows rules in numbered order so that you can delete specific rules
sudo ufw delete 1 – Deletes rule based on number
sudo ufw allow from 192.168.1.2 – Allows traffic from a specific IP address to all ports
sudo ufw allow from 192.168.1.0/24 – Allows traffic from a subnet to all ports
sudo ufw allow from 192.168.1.2 to any port 22 – Allows traffic from a specific IP address to a specific port
sudo ufw allow from 192.168.1.0/24 to any port 22 – Allows traffic from a subnet to a specific port
sudo ufw reset – Deletes all rules and disables ufw

Nguồn: https://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/

12 Comments

Aaron

April 28, 2020

Allowing only a specific ip-address to access does not work if the client is using DHCP right?

Reply

Production Penguin

April 28, 2020

awesome video, subscribed!

Reply

geekPanther

April 28, 2020

Very informative video and Thank you so much for Adding those UFW commands on the description, It really make life lot easier.

Reply

acb dxb

April 28, 2020

sometimes the ftp service ufw doesn't let the ftp work and then when i write "ufw allow proto ftp to any port 21" it returns with "ERROR: Unsupported protocol 'ftp'". Is there a solution to my problem and why is this happening?

Reply

Karthick Narayanan

April 28, 2020

Hey eli it's amazing that u made the learning new technologies much in ease manner, y don't u prefer doing videos about RPA(Robotic Process Autonation)

Reply

-

April 28, 2020

3:12 – I want my specific login to access SSH (and FTP) regardless of my IP address (I want to access the server from other systems without granting the system specifically access), but FTP and SSH have thus far thwarted my attempts to log in from outside my LAN. :-

Reply

Chris Wiley

April 28, 2020

Thank you so much for this series. I've learned a ton so far.

Reply

mdd1963

April 28, 2020

Great tutorial, Sir!

Reply

Mohammed Barsad

April 28, 2020

Thanks sir , your MCSC course was very worthy for me and God bless you

Reply

mdd1963

April 28, 2020

'impore-TUNT' 🙂 (Other 'Eli-isms' – industry = INN-doss-tree) 🙂

Reply

TARGET LOCKED

April 28, 2020

It's so simple rules like dog commands.

Reply

ronald jorgensen

April 28, 2020

my system is 10 years old should I start fresh to use this Linux

Reply

Leave a Reply