Hint: Security means keeping strangers out and data safe [OK]
Common Mistakes:
Confusing security with device performance
Thinking security changes hardware features
Ignoring data protection importance
2. Which of the following is the correct way to set a password on a Raspberry Pi to improve security?
easy
A. Use the command passwd and enter a strong password
B. Use the command setpassword with any password
C. Change the password by editing /etc/passwd manually
D. No need to set a password if the device is offline
Solution
Step 1: Identify the standard command for changing passwords
The passwd command is the official and safe way to change passwords on Raspberry Pi.
Step 2: Evaluate other options for correctness
setpassword is not a valid command; editing /etc/passwd manually is risky and not recommended; offline devices still need passwords for security.
Final Answer:
Use the command passwd and enter a strong password -> Option A
Quick Check:
Use passwd command = Correct password setting [OK]
Hint: Use the official passwd command for passwords [OK]
Common Mistakes:
Trying to edit system files manually
Using non-existent commands
Assuming offline means no security needed
3. What will be the output of this Python code running on a Raspberry Pi that checks if a device is secure based on password strength?
password = 'abc123'
if len(password) >= 8 and any(c.isdigit() for c in password) and any(c.isalpha() for c in password):
print('Secure')
else:
print('Not Secure')
medium
A. Secure
B. Not Secure
C. SyntaxError
D. No output
Solution
Step 1: Check password length condition
The password 'abc123' has length 6, which is less than 8, so the first condition fails.
Step 2: Evaluate the full if condition
Since the length condition is false, the whole condition is false, so the else block runs.
Final Answer:
Not Secure -> Option B
Quick Check:
Password length < 8 = Not Secure [OK]
Hint: Check length first; less than 8 means not secure [OK]
Common Mistakes:
Ignoring length check
Assuming presence of digits and letters is enough
Confusing syntax with logic errors
4. Find the error in this Raspberry Pi Python script that tries to block unauthorized IP addresses: