nerdexam
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

XK0-006 question #58 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)
  • A
    16% (8)
  • B
    75% (38)
  • C
    6% (3)
  • D
    4% (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.

Full XK0-006 Practice