Which of the following commands sets the SetUID permission on the executable /bin/foo?
Which of the following commands sets the SetUID permission on the executable /bin/foo?
To set the SetUID permission on an executable, the correct command is to use chmod 4755 /bin/foo. The first digit '4' in '4755' sets the SetUID bit, while the remaining digits '755' set the standard read, write, and execute permissions for the owner, and read and execute permissions for group and others.
For the special permissions, you prepend these numbers with another number where 4 is setuid, 2 is setgid, and 1 is the sticky bit
Correct answer is A.
Correct Answer: A
To set SUID: ~$ chmod 4755 test-SetUID ~$ ls -l test-SetUID -rwsr-xr-x 1 neo neo 0 jul 1 19:37 test-SetUID To remove it: ~$ chmod 0755 test-SetUID ~$ ls -l test-SetUID -rwxr-xr-x 1 neo neo 0 jul 1 19:20 test-SetUID