MENU

Fun & Interesting

Permissions in Linux | RHEL

Suyash Gaikwad 13 1 week ago
Video Not Working? Fix It Now

# Permissions in Linux..! **R** → Read or List **W** → Write → Create or Delete **X** → Enter Into Directory, Execute an Executable file. RWX - R → 4 W → 2 X → 1 2^0 2^1 2^2 **User Types:** - **User (Owner)** → The creator of the file/directory. - **Group** → Users belonging to the same group. - **Others** → All other users. **Read Access Includes:** - Read and Execute **Write Access Includes:** - Read and Execute **Example Permissions for a File Named "student"** - **Owner:** `rwx` (Full permissions) - **Group:** `rwx` (Full permissions) - **Others:** `r_x` (Read and execute, no write permission) **Create a Directory and Check Permissions** Command: `mkdir /test` Command: `ls -ld /test` - Lists directory with long listing format to check permissions. **Modify Permissions for Others** Command: `chmod o-x /test` - Removes execute permission for others. Command: `chmod o+x /test` - Adds execute permission for others. ### Sticky Bit - Used on directories with full permissions to restrict file deletion. - Prevents users from deleting files they don’t own. **Apply Sticky Bit** Command: `chmod 1777 /test` - Allows everyone to create files but only the owner can delete their own files. **Check Sticky Bit in Long Listing Format** - `T + x = t` which appears in `ls -l` output. **Remove or Add Sticky Bit** Command: `chmod o+t /test` - Adds the sticky bit. Command: `chmod o-t /test` - Removes the sticky bit. **Set Full Permissions with Sticky Bit** Command: `chmod 0777 /test` - Grants full permissions to all users (use with caution).

Comment