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.
Correct. 4 for SUID followed by 755 gives 4755.
2755Incorrect. 2 selects SGID.
Incorrect. 2 selects SGID.
1755Incorrect. 1 selects the sticky bit.
Incorrect. 1 selects the sticky bit.
0755Incorrect. 0 sets no special bit.
Incorrect. 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 / 空の一時ファイル
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.