How would you add write permission for the owner and read/write permissions for the group to bob.txt using symbolic notation?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

How would you add write permission for the owner and read/write permissions for the group to bob.txt using symbolic notation?

Explanation:
Symbolic chmod lets you grant or adjust permissions for specific user classes (owner, group, others) without touching the rest. To meet the goal you need to give the owner only write permission and give the group both read and write permissions. You can do this in one command by using u+w for the owner and g+rw for the group, separated by a comma: sudo chmod u+w,g+rw bob.txt. This adds exactly what’s required: the owner gains write access, and the group gains read and write access, without changing other permissions. The other approaches either alter the wrong class or add permissions you didn’t intend. For example, changing only the group’s permissions doesn’t give the owner write access; changing others would affect everyone else, which isn’t requested; and giving the owner both read and write without touching the group misses the group requirement.

Symbolic chmod lets you grant or adjust permissions for specific user classes (owner, group, others) without touching the rest. To meet the goal you need to give the owner only write permission and give the group both read and write permissions. You can do this in one command by using u+w for the owner and g+rw for the group, separated by a comma: sudo chmod u+w,g+rw bob.txt. This adds exactly what’s required: the owner gains write access, and the group gains read and write access, without changing other permissions.

The other approaches either alter the wrong class or add permissions you didn’t intend. For example, changing only the group’s permissions doesn’t give the owner write access; changing others would affect everyone else, which isn’t requested; and giving the owner both read and write without touching the group misses the group requirement.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy