Set tool to ordinary mode 755 and add set-user-ID.
Which four-digit mode is appropriate?
The special-mode digit uses SUID=4, SGID=2, sticky=1. Combining SUID with 755 gives 4755.
Detailed explanation
4755Correct. 4 for SUID followed by 755 gives 4755.
2755Incorrect. 2 selects SGID.
1755Incorrect. 1 selects the sticky bit.
0755Incorrect. 0 sets no special bit.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp); chmod 4755 "$tmp"; stat -c '%a' "$tmp"; rm -f "$tmp"Expected result
4755Key points
- SUID=4
- SGID=2
- Sticky=1
Notes
- Environment: GNU coreutils 9.x / 空の一時ファイル
- Use a disposable file or directory when checking chmod calculations.
- Exact permission display can vary slightly with filesystem and distribution defaults.
Foundation review
Place the operation
4755 combines SUID with ordinary mode 755; the special field is separate from the three permission triplets.
Check the side effect
Read all four digits from left to right and confirm special-bit letters with ls or stat.