XK0-005 · Question #145
Ann, a Linux administrator, wants to edit a configuration management file. When she opens the file to edit, her text editor reports that the file has been opened in read-only mode. She then tries to…
The correct answer is C. chattr -i infrastructure.yml. Using "-i" removes the immutable attribute and a "+i" would add it. D would not help since the file was not able to be written to using sudo when the owner is root and the group owner is wheel.
Question
Ann, a Linux administrator, wants to edit a configuration management file. When she opens the file to edit, her text editor reports that the file has been opened in read-only mode. She then tries to edit the file as root by elevating via sudo and is still unable to save any changes. The error message in her text editor says that the read-only option is set on the file. Ann checks the permissions on the file and sees the following:
-rw-rw-r-- 1 root wheel 30 Jun 13 15:38 infrastructure.yml Which of the following commands is the BEST option to allow her to successfully modify the file?
Options
- Achmod 600 infrastructure.yml
- Bchown root: infrastructure.yml
- Cchattr -i infrastructure.yml
- Dchmod o+w infrastructure.yml
How the community answered
(38 responses)- A11% (4)
- B21% (8)
- C63% (24)
- D5% (2)
Explanation
Using "-i" removes the immutable attribute and a "+i" would add it. D would not help since the file was not able to be written to using sudo when the owner is root and the group owner is wheel.
Topics
Community Discussion
No community discussion yet for this question.