PERMISSIONS(oh) LOCAL PERMISSIONS(oh) permissions - assign and modify file permissions. TYPES Permission types can be an octal number or an symbols. Type | Octal | Symbol None | 0 | Execution | 1 | x Write | 2 | w Read | 4 | r Permissions can be assigned by adding the octal values or assigning the symbols. Example - Write (2) + Read (4) = 6 - w+r ASSIGNMENT When a user creates a file or directory, it's assigned as the owner, and its main group is assigned as the owner group. Format The permissions are displayed with the following format: owner, group owner, other groups, all users. Example: $ whoami user1 $ groups users $ ls -l -rwxr-xr-- 1 user1 users .... file1 - user1 is the owner and has permissions to read, write and execute. - The users corresponding to the group users have permissions to read and execute. - Users from other groups have permissions to read. - The corresponding octal value is 754. COMMANDS Important Users can modify permissions on files if they have write permissions. chown Modifies the owner of a file or directory. Modify user : chown username filename Modify user and group : chown username:groupname filename To modify recursively, use -R. chmod Changes the permissions on a file or directory as explained in Sx TYPES. To assign (=), add (+) or remove (-) permissions, the who symbols can be used for user (u), group (g) or other (o). Change | Command Octal assignment | chmod 755 file Add write permissions for group | chmod g+w file Assign read and write permissions to others | chmod o=rw file Remove read permission to other groups and users | chmod o-r file When using the octal value or assigning using =, the previous permissions are overwritten. chgrp chgrp -R GROUP DIRECTORY TODO - Add sticky bit and execute bit. SEE ALSO user_management(oh) - OpenBSD manpages: chmod(1) , chgrp(1) , chown(8) AUTHORS ohazot(oh) | about(oh) | ohazot.com: https://ohazot.com OpenBSD 7.8 , linux | Created:2026-03-26|Updated:2026-03-26| PERMISSIONS(oh)