Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to enable the UFW firewall.
Linux CLI
sudo ufw [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'disable' instead of 'enable' will turn the firewall off.
Using 'status' only shows the current state, it does not enable the firewall.
✗ Incorrect
Use ufw enable to turn on the firewall.
2fill in blank
mediumComplete the code to allow incoming SSH connections using UFW.
Linux CLI
sudo ufw [1] ssh Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deny' or 'reject' blocks SSH connections.
Using 'limit' restricts connections but does not fully allow them.
✗ Incorrect
Use ufw allow ssh to permit SSH traffic through the firewall.
3fill in blank
hardFix the error in the iptables command to list all rules with line numbers.
Linux CLI
sudo iptables -[1] --line-numbers Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'l' causes an error.
Using 'list' as a full word is not valid in iptables options.
✗ Incorrect
The correct option to list rules is -L. It shows all rules with optional line numbers.
4fill in blank
hardFill both blanks to add a rule that drops incoming TCP packets on port 80 using iptables.
Linux CLI
sudo iptables -A INPUT -p [1] --dport [2] -j DROP
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using UDP instead of TCP will not match HTTP traffic.
Using port 22 blocks SSH, not HTTP.
✗ Incorrect
Use protocol tcp and port 80 to drop HTTP traffic.
5fill in blank
hardFill all three blanks to create a UFW rule that limits incoming connections on port 22.
Linux CLI
sudo ufw [1] [2]/[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deny' blocks all connections instead of limiting.
Omitting the protocol may cause the rule to be less specific.
✗ Incorrect
The command ufw limit 22/tcp limits SSH connections to prevent brute force attacks.