Bird
0
0

Given the Mosquitto configuration snippet:

medium📝 Predict Output Q5 of 15
Raspberry Pi - MQTT for IoT
Given the Mosquitto configuration snippet:
listener 1884
allow_anonymous false
password_file /etc/mosquitto/passwd

What happens if a client tries to connect without a username and password?
AConnection is refused
BConnection is accepted anonymously
CClient is connected but cannot publish
DBroker crashes
Step-by-Step Solution
Solution:
  1. Step 1: Analyze allow_anonymous setting

    Setting 'allow_anonymous false' disables anonymous connections; clients must authenticate.
  2. Step 2: Understand password_file role

    The password_file defines valid usernames and passwords for authentication.
  3. Step 3: Predict client connection behavior

    Clients without credentials will be refused connection by the broker.
  4. Final Answer:

    Connection is refused -> Option A
  5. Quick Check:

    Anonymous connections allowed? No = Connection refused [OK]
Quick Trick: Disallow anonymous means clients must authenticate [OK]
Common Mistakes:
MISTAKES
  • Assuming anonymous connections allowed
  • Thinking client can connect but not publish

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes