| Permission | Action | Chmod Option |
|---|---|---|
| Read | View | r or 4 |
| Write | Edit | w or 2 |
| Execute | Execute | x or 1 |
There are also three types of user restrictions:
| User | ls Output |
|---|---|
| Owner | -rwx------ |
| Group | ----rwx--- |
| Other | -------rwx |
Understanding of Symbolic Notation:
| Symbolic Notation | Octal Notation | Meaning |
|---|---|---|
| ---------- | 0000 | No Permissions |
| ---x--x--x | 0111 | Execute |
| --w--w--w- | 0222 | Write |
| --wx-wx-wx | 0333 | Write & Execute |
| -r--r--r-- | 0444 | Read |
| -r-xr-xr-x | 0555 | Read & Execute |
| -rw-rw-rw- | 0666 | Read & Write |
| -rwxrwxrwx | 0777 | Read, Write & Execute |
Example:
If permission like 755,
- 7 - rwx (Owner can read, write & execute)
- 5 - r-x (Group user can read & execute)
- 5 - r-x (Group user can read & execute)
On production server, this kind of permission is useful & secure.
For files:
- sudo find ./ -type f -exec chmod 644 {} \;
For folders:
- sudo find ./ -type d -exec chmod 755 {} \;

Comments
Post a Comment