nerdexam
CompTIA

XK0-005 · Question #33

Ann, a junior systems administrator, is required to add a line to the /etc/yum.conf file. However, she receives the following error message when she tries to add the line: Ann performs some…

The correct answer is C. chattr -I /etc/yum.conf. The 'chattr' command manages extended file attributes on Linux filesystems. When a file has the immutable attribute set ('+i'), no user - not even root - can modify, delete, rename, or create hard links to it. This would explain Ann's error despite having root or sufficient…

Troubleshooting

Question

Ann, a junior systems administrator, is required to add a line to the /etc/yum.conf file. However, she receives the following error message when she tries to add the line:

Ann performs some diagnostics to attempt to find the root cause:

Which of the following commands should Ann execute to write content to /etc/yum?

Options

  • Achmod 755 /etc/yum.conf
  • Bsetfacl -m m:rw /etc/yum.conf
  • Cchattr -I /etc/yum.conf
  • Dsetenforce 0

How the community answered

(25 responses)
  • A
    8% (2)
  • B
    4% (1)
  • C
    72% (18)
  • D
    16% (4)

Explanation

The 'chattr' command manages extended file attributes on Linux filesystems. When a file has the immutable attribute set ('+i'), no user - not even root - can modify, delete, rename, or create hard links to it. This would explain Ann's error despite having root or sufficient permissions. 'chattr -i /etc/yum.conf' removes the immutable flag, allowing the file to be edited again. Option A ('chmod 755') changes standard read/write/execute permissions but cannot override the immutable attribute. Option B ('setfacl -m m:rw') modifies Access Control Lists but similarly cannot bypass an immutable flag. Option D ('setenforce 0') disables SELinux enforcement, which addresses SELinux denials - a different issue than file immutability.

Topics

#File attributes#`chattr` command#Filesystem management#Troubleshooting file permissions

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice