CompTIA
XK0-006 · Question #58
A systems administrator attempts to edit a file as root, but receives the following error: Which of the following commands allows the administrator to edit the file?
The correct answer is B. chattr -i /etc/resolv.conf. The lsattr output shows the immutable (i) attribute set on /etc/resolv.conf. This prevents any modifications, even by root. Running chattr -i removes the immutable flag, allowing the administrator to edit the file.
Troubleshooting
Question
A systems administrator attempts to edit a file as root, but receives the following error:
Which of the following commands allows the administrator to edit the file?
Exhibit
Options
- Achown root /etc/resolv.conf
- Bchattr -i /etc/resolv.conf
- Cchmod 750 /etc/resolv.conf
- Dchgrp root /etc/resolv.conf
How the community answered
(51 responses)- A16% (8)
- B75% (38)
- C6% (3)
- D4% (2)
Explanation
The lsattr output shows the immutable (i) attribute set on /etc/resolv.conf. This prevents any modifications, even by root. Running chattr -i removes the immutable flag, allowing the administrator to edit the file.
Topics
#chattr#immutable file#file attributes#file permissions
Community Discussion
No community discussion yet for this question.
