nerdexam
LPI

101-400 · Question #447

Which of the following commands enables the setuid (suid) permission on the executable /bin/foo?

The correct answer is B. chmod 4755 /bin/foo. See the full explanation below for the reasoning.

Question

Which of the following commands enables the setuid (suid) permission on the executable /bin/foo?

Options

  • Achmod 1755 /bin/foo
  • Bchmod 4755 /bin/foo
  • Cchmod u-s /bin/foo
  • Dchmod 755+s /bin/foo

How the community answered

(24 responses)
  • A
    8% (2)
  • B
    83% (20)
  • C
    4% (1)
  • D
    4% (1)

Community Discussion

3
Samuel O.Samuel O.Jun 26, 2026

B is your answer. The leading 4 in octal mode sets the setuid bit, so chmod 4755 /bin/foo gives the file setuid plus the usual rwxr-xr-x permissions, which is exactly what you need when you want the executable to run as its owner rather than the calling user, same as passwd does in the real world.

20
Viktor S.Viktor S.Jun 26, 2026

B is right. The leading 4 in the four-digit octal representation sets the setuid bit, so 4755 means setuid on, rwxr-xr-x underneath. C is the trap, because u-s actually removes setuid, which is the opposite of what the question asks, and people who half-remember symbolic mode syntax will burn themselves on that one.

5
Wesley A.Wesley A.Jun 22, 2026

B is right, 4 sets the suid bit, not 1 (that's sticky).

-1
Full 101-400 Practice