Which of the following commands will achieve this goal?

A Linux administrator wants to set the SUID of a file named dev_team.text with 744 access rights.

Which of the following commands will achieve this goal?
A . chmod 4744 dev_team.txt
B . chmod 744 –setuid dev_team.txt
C . chmod -c 744 dev_team.txt
D . chmod -v 4744 –suid dev_team.txt

Answer: A

Explanation:

The command that will set the SUID of a file named dev_team.txt with 744 access rights is chmod 4744 dev_team.txt. This command will use the chmod utility to change the file mode bits of dev_team.txt. The first digit (4) represents the SUID bit, which means that when someone executes dev_team.txt, it will run with the permissions of the file owner. The next three digits (744) represent the read, write, and execute permissions for the owner (7), group (4), and others (4). This means that the owner can read, write, and execute dev_team.txt, while the group and others can only read it.

The other options are not correct commands for setting the SUID of a file with 744 access rights. The chmod 744 –setuid dev_team.txt command is invalid because there is no –setuid option in chmod.

The chmod -c 744 dev_team.txt command will change the file mode bits to 744, but it will not set the SUID bit. The -c option only means that chmod will report when a change is made. The chmod -v 4744 –suid dev_team.txt command is also invalid because there is no –suid option in chmod. The -v option only means that chmod will output a diagnostic for every file processed.

Reference: CompTIA

Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing Users and Groups; chmod(1) – Linux

manual page

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments