A user reports that they are unable to write to a file named 'report.txt' located in their home directory. However, they have confirmed that they can read the file. Which of the following is the BEST action to take in order to grant the user write access to the file?
Change the file permissions to allow write access for the user
Edit the /etc/fstab file to alter mounting options for the user's home directory
Restart the file service to refresh user permissions
Change the ownership of the file using the chown command
The correct answer is 'Change the file permissions to allow write access for the user'. Since the user already has read access and only needs write access, modifying the file permissions using the chmod command is the most straightforward approach. The other options do not directly address the specific issue at hand. Changing the file ownership with chown is unnecessary and potentially risky if the user already owns the file. Editing the /etc/fstab file would typically configure file system mount options, not individual file permissions. Restarting the file service is unrelated to file permissions, and would not remedy the user's inability to write to the file.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are file permissions in Linux?
Open an interactive chat with Bash
What is the `chmod` command and how is it used?
Open an interactive chat with Bash
What is the difference between file ownership and permissions?