Chmod 4000
Chmod 4000 (chmod a-rwx,ug+s,+t,g-s,-t) sets permissions so that, (U)ser / owner can't read, can't write and can't execute. (G)roup can't read, can't write and can't execute. (O)thers can't read, can't write and can't execute.
Special bits
Extra chmod command options
Output
Modifiers
Octal CHMOD command
$ chmod -R 4000 folder_name
Symbolic CHMOD command
$ chmod -R a-rwx,ug+s,+t,g-s,-t folder_name
Chmod Permissions for chmod 4000
Chmod owner
- Owner can't read
- Owner can't write
- Owner can't execute
Chmod group
- Group can't read
- Group can't write
- Group can't execute
Chmod other
- Others can't read
- Others can't write
- Others can't execute
How chmod 4000 looks in file listing
For files
After changing a file's mode to 4000, the file appears as:
- --S------
For folders
After changing a directory's mode to 4000, the folder appears as:
d --S------