How would you set the same permissions in binary mode?

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 set the same permissions in binary mode?

Explanation:
Permissions are stored as three 3-bit groups for user, group, and others. Each group uses bits for read, write, and execute, and the octal digits you pass to chmod are just sums of those bits: read = 4, write = 2, execute = 1. If you convert each digit to binary, 7 is 111, 6 is 110, and 5 is 101. Put together, that gives the binary pattern 111 110 101. That means owner has rwx, group has rw-, and others have r-x. This particular binary sequence is what you’re aiming for when you say “set the same permissions in binary mode,” and the corresponding octal digits are 7, 6, and 5 in that order. Other options produce different binary patterns, for example 111 110 100 or 110 110 110 or 111 101 101, so they don’t match the intended binary sequence. Therefore the mode that encodes 111 110 101 is the one that fits.

Permissions are stored as three 3-bit groups for user, group, and others. Each group uses bits for read, write, and execute, and the octal digits you pass to chmod are just sums of those bits: read = 4, write = 2, execute = 1.

If you convert each digit to binary, 7 is 111, 6 is 110, and 5 is 101. Put together, that gives the binary pattern 111 110 101. That means owner has rwx, group has rw-, and others have r-x. This particular binary sequence is what you’re aiming for when you say “set the same permissions in binary mode,” and the corresponding octal digits are 7, 6, and 5 in that order.

Other options produce different binary patterns, for example 111 110 100 or 110 110 110 or 111 101 101, so they don’t match the intended binary sequence. Therefore the mode that encodes 111 110 101 is the one that fits.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy