Chmod 4700 Explained
Chmod 4700: SUID with owner-only access. The program runs as the owner but only the owner can execute it. Highly restricted SUID.
Permission
4700
rws------
chmod 4700 filename
Permission Breakdown
| Role | Read (4) | Write (2) | Execute (1) | Octal | Meaning |
|---|---|---|---|---|---|
| Owner | r | w | x | 7 | read, write, execute |
| Group | - | - | - | 0 | no permissions |
| Others | - | - | - | 0 | no permissions |
Visual Permission Grid
Detailed Explanation
The permission 4700 sets the SUID bit on a file that only the owner can access.
Octal breakdown:
- 4 (Special): SUID bit set
- 7 (Owner): read (4) + write (2) + execute (1) = full access
- 0 (Group): no access
- 0 (Others): no access
In symbolic notation this is rws------. The s in the owner execute position indicates SUID. Only the owner can read, write, and execute the file. Group and others have no access at all.
This is an interesting edge case: the SUID bit means the program would run as the owner, but since only the owner can execute it, the SUID bit is essentially redundant. The owner already runs programs as themselves. This permission is sometimes set as a precautionary measure during development of SUID programs, allowing the developer to test before opening execution to others.
Use Case
Used during development and testing of SUID programs. The developer can test the SUID behavior in isolation before opening execution to the group (4750) or everyone (4755).