The permission 400
in Linux refers to file permissions that you can set using the chmod
command. Here’s what it means:
Breakdown of 400
Permission
Permissions in Linux are represented by three digits:
- The first digit is for the owner (user).
- The second digit is for the group.
- The third digit is for others.
Each digit can be the sum of:
-
4 = read (
r
) -
2 = write (
w
) -
1 = execute (
x
)
So:
-
400 =
4
(read for owner) +0
(no permissions for group) +0
(no permissions for others)
Symbolic representation:
-r--------
Meaning
- Owner: Can read the file, but cannot write or execute.
- Group: Cannot read, write, or execute.
- Others: Cannot read, write, or execute.
When to Use 400 Permission?
-
Sensitive files:
Use for files that should only be read by the owner (e.g., private keys like
id_rsa
for SSH).
How to Set 400 Permission
chmod 400 filename
Example:
chmod 400 id_rsa
This makes id_rsa
readable only by you (the file’s owner), which is often required by SSH.
Summary Table
User | Read | Write | Execute |
---|---|---|---|
Owner | ✔️ | ❌ | ❌ |
Group | ❌ | ❌ | ❌ |
Others | ❌ | ❌ | ❌ |
Bottom line:
-
400
= Only the file’s owner can read it. - Typical for sensitive, private files (like SSH keys).
Let me know if you want to understand other permission numbers!
Top comments (0)