Bird
0
0

You want to secure your Raspberry Pi by allowing SSH access only from a specific IP address 192.168.1.100 and blocking all other SSH attempts. Which ufw commands achieve this?

hard🚀 Application Q15 of 15
Raspberry Pi - Security and Deployment
You want to secure your Raspberry Pi by allowing SSH access only from a specific IP address 192.168.1.100 and blocking all other SSH attempts. Which ufw commands achieve this?
Asudo ufw allow from any to any port 22 sudo ufw deny from 192.168.1.100
Bsudo ufw allow from 192.168.1.100 to any port 22 sudo ufw deny 22
Csudo ufw deny ssh sudo ufw allow 22
Dsudo ufw allow ssh sudo ufw deny from 192.168.1.100 to any port 22
Step-by-Step Solution
Solution:
  1. Step 1: Allow SSH only from the specific IP

    Use sudo ufw allow from 192.168.1.100 to any port 22 to permit SSH from that IP.
  2. Step 2: Deny all other SSH connections

    Use sudo ufw deny 22 to block SSH from all other IPs.
  3. Final Answer:

    sudo ufw allow from 192.168.1.100 to any port 22 sudo ufw deny 22 -> Option B
  4. Quick Check:

    Allow specific IP then deny all others = sudo ufw allow from 192.168.1.100 to any port 22 sudo ufw deny 22 [OK]
Quick Trick: Allow specific IP first, then deny all others [OK]
Common Mistakes:
MISTAKES
  • Allowing SSH globally before denying specific IP
  • Denying the allowed IP instead of others
  • Using wrong port numbers or commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes