hardMultiple ChoiceObjective-mapped
220-1202 Practice Question: A malicious script is suspected to have changed…
A malicious script is suspected to have changed permissions on critical system files. The administrator needs to restore the /etc/passwd file to its default permissions, which are 644. The file is currently 777. Which command will set the correct permissions?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
chmod 644 /etc/passwd
Chmod 644 /etc/passwd sets the permissions to rw-r--r--, which is the standard for /etc/passwd. This removes the world-writable and executable bits.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
chmod 644 /etc/passwd
Why this is correct
This command correctly sets the permissions for /etc/passwd. The `6` grants read and write access to the owner (typically root), while the first `4` grants read-only access to the group, and the second `4` grants read-only access to others. This configuration is the secure default, allowing system processes and users to read necessary account information without permitting unauthorized modifications, which is crucial for system functionality and security.
- ✗
chmod 600 /etc/passwd
Why it's wrong here
Applying `chmod 600` to /etc/passwd restricts all access to the file except for the owner, granting only read and write permissions to `root`. While this might seem highly secure, it critically prevents other users and many essential system utilities from reading the file. This would cause critical system functions, such as user authentication and displaying user information, to fail, leading to significant operational issues and system instability.
- ✗
chmod 755 /etc/passwd
Why it's wrong here
Setting /etc/passwd permissions to `755` is inappropriate and introduces a severe security risk. The `7` grants read, write, and execute permissions to the owner, while the `5` grants read and execute permissions to the group and others. Granting execute permissions on a plain text data file like /etc/passwd is entirely unnecessary and could potentially be exploited by malicious scripts attempting to execute non-executable content, compromising system integrity.
- ✗
chmod 444 /etc/passwd
Why it's wrong here
Using `chmod 444` on /etc/passwd makes the file read-only for everyone, including the owner, group, and others. While it allows all users to read the file, it critically removes the owner's (root's) write permission. This prevents any modifications to the user database, meaning operations like adding new users, changing passwords, or updating user information would fail, rendering user management impossible and breaking core system functionality.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 220-1202 question from scratch — 495 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 220-1202 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 220-1202 exam.