Fact-checked by Grok 2 weeks ago

chmod

chmod is a command-line utility in Unix-like operating systems that changes the access permissions, or mode bits, of files and directories, determining who can read, write, execute, or traverse them. The utility modifies any or all of the specified file mode bits for each provided file operand according to the mode specification, which can be expressed in either form (such as u+rwx for adding read, write, and execute permissions to the /owner) or as an number (such as 755 representing owner read/write/execute, group read/execute, and others read/execute). Defined in the POSIX.1 standard, chmod is essential for system security, ensuring proper , and is implemented in core utility packages like Coreutils, where it supports recursive operations on directories via the -R option and verbose output with -v. In symbolic mode, permissions are adjusted relative to the owner (u), group (g), others (o), or all (a), using operators like + (add), - (remove), or = (set exactly), combined with r (read), w (write), x (execute), and special flags like s (setuid/setgid) or t (sticky bit). Octal mode uses three-digit numbers from 0 to 7, where each digit corresponds to owner, group, and others permissions, with bits for read (4), write (2), and execute (1), plus additional bits for special modes (e.g., 4 for setuid). When a symbolic link is specified on the command line, chmod changes the permissions of the target in GNU and POSIX-compliant implementations, rather than the link itself, and it requires appropriate privileges, such as ownership or superuser access, to succeed. The command is widely used in scripting and administration to enforce the principle of least privilege, preventing unauthorized access in multi-user environments.

Introduction

Purpose and Scope

The chmod command is a command-line utility in operating systems that modifies the access permissions, or mode bits, of files and directories. It enables users to control who can read, write, or execute files, thereby enforcing security and within the . At its core, chmod alters the read (r), write (w), and execute (x) permissions assigned to three categories: the file owner (user), the owner's group, and all other users. These changes are applied recursively to directories if specified, affecting the entire while preserving the underlying permission model of the system. The command's scope encompasses all major operating systems, including distributions, macOS, and BSD variants, where it forms a fundamental part of management. It is not natively available in Windows but can be used through compatibility layers such as , which emulates Unix permissions, or (WSL), which supports metadata for permission changes on mounted drives. chmod has been ubiquitous in Unix-like systems since the early 1970s, first documented in the Unix Programmer's Manual's initial editions developed at . Detailed historical evolution is addressed in subsequent sections.

Unix Permission Model

In operating systems, the permission model provides a standardized mechanism for controlling access to files and directories, as specified in the standard. This model divides users into three categories: the file owner (user or u), the owner's group (group or g), and all other users (others or o). Each category is assigned a triplet of permission bits: read (r, value 4 in ), write (w, value 2), and execute/search (x, value 1). These bits form a 9-bit permission word, where the total value for each triplet ranges from 0 (no permissions) to 7 (all permissions). The permissions are visually represented in the output of the ls -l command, which displays a 10-character string beginning with the file type indicator (e.g., '-' for a file, 'd' for a ), followed by three groups of three characters each representing the read (r), write (w), and execute/search (x) permissions for the owner, group, and others, where special permissions may appear in the execute positions (e.g., 's' for /setgid if execute is set, or 'S'/'T' otherwise). For instance, the mode string -rwxr-xr-x decodes as: owner has read, write, and execute (rwx); group has read and execute (r-x); others have read and execute (r-x). The absence of a permission is indicated by '-', such as 'r--' for read-only. This format allows quick assessment of access rights at a glance. Beyond the standard bits, three special permissions occupy higher-order bits, often prefixed as a fourth digit (values 4 for , 2 for setgid, and 1 for ). The bit (S_ISUID) causes a program to execute with the effective user ID of the owner rather than the caller, enhancing for privileged operations. The setgid bit (S_ISGID) similarly applies the file's group ID, useful for group-shared resources like directories where new files inherit the group ownership. The (S_ISVTX), when set on directories, restricts deletion or renaming of files to only the owner, the directory owner, or a privileged user, commonly used in shared temporary directories like /tmp. These special bits appear as uppercase letters in output (e.g., 's' for setuid/setgid) if execute is also set, or as 'S'/'T' if execute is absent. When files or directories are created, their initial permissions are derived from system defaults modified by the process's file mode creation mask, set via the umask or . The default mode is typically 0666 (rw-rw-rw-) for regular files and 0777 (rwxrwxrwx) for directories, from which the value (a bitwise AND complement) subtracts permissions to enforce . A common umask of 0022 removes write permissions for group and others, yielding 0644 (rw-r--r--) for files and 0755 (rwxr-xr-x) for directories, ensuring new files are readable but not writable by non-owners unless explicitly allowed. The applies only at creation and does not affect existing files. The meaning of the execute bit varies by file type: for regular files, execute permission allows the file to be run as a or , provided the user has appropriate access to invoke it. For directories, execute (x) grants the ability to traverse or access the 's contents (e.g., via cd or path resolution), but listing files requires read (r) permission, and modifying contents (creating, deleting, or renaming) requires write (w). Without execute on a , even owned files within it may be inaccessible via pathname. This distinction ensures controlled in hierarchical file systems.

Command Syntax

Basic Syntax

The chmod command adheres to the general form chmod [options] mode file..., where optional options modify the command's behavior, the mode operand defines the permission changes, and one or more file operands specify the targets affected. The mode serves as the permission specifier, dictating the access rights to apply to the target files, and it can take either an octal or symbolic representation without specifying the exact format here. The operand(s) identify the targets, which may consist of a single , multiple files provided as separate arguments, shell-expanded patterns using wildcards for bulk operations, or directories. The command returns an of 0 upon success, indicating all requested changes were applied; a non-zero signals an error, such as insufficient privileges or invalid arguments. chmod executes within the context of the invoking user's privileges, allowing only the owner or processes with () capabilities to alter bits, though possesses the authority to modify permissions on any object.

Arguments

The chmod command requires a followed by one or more as its primary arguments. The , positioned immediately after any options, specifies the desired permissions and can be provided in either or notation; notation uses a numeric value representing absolute permissions (e.g., 755), while notation describes relative changes (e.g., u+x) without delving into the specifics of permission . File operands, which follow the mode operand, consist of paths to the target or whose modes are to be changed. These paths can be absolute (starting from the , e.g., /home/user/[file](/page/File).txt) or relative (relative to the current , e.g., [file](/page/File).txt), and chmod attempts to access and modify each specified in sequence. If a operand refers to a non-existent or , the command fails for that operand with an appropriate , such as ENOENT (no such or ), but continues processing subsequent operands if possible. Multiple targets can be specified by listing several file operands separated by spaces (e.g., chmod 644 file1.txt file2.txt), allowing batch modification of permissions across files or directories. Additionally, shell globbing patterns, such as *.txt, can be used to match multiple files implicitly through the shell's expansion before the arguments are passed to chmod, though this is a feature of the invoking shell rather than the command itself. Invalid arguments trigger error handling by chmod, which reports diagnostics to and sets a non-zero . For instance, an invalid mode operand results in an indicating the issue. When interacting with the , file operands containing spaces or special characters must be quoted to prevent misinterpretation (e.g., chmod 644 "my file.txt"), as the parses unquoted arguments into separate tokens, potentially leading to unexpected targets or syntax errors.

Permission Specification

Octal Notation

Octal notation provides a numeric for specifying file permissions in the chmod command, representing the as an (base-8) number typically consisting of three or four digits, each ranging from 0 to 7. This notation directly corresponds to the underlying permission bits, where each digit encodes the three bits for read (value 4), write (value 2), and execute (value 1) permissions, summed additively for the desired combination. The first three digits (or last three in a four-digit ) assign permissions to the owner, group, and , respectively; for instance, the 755 translates to rwxr-xr-x, granting full read, write, and execute permissions (7 = 4+2+1) to the owner and read-plus-execute (5 = 4+1) to the group and . To derive an value, permissions are calculated by adding the bit values for each category. For example, to set read and write for the owner (4+2=6) while allowing only read for the group and others (4 each), the resulting mode is 644, as in chmod 644 filename, which sets rw-r--r--. Another common case is 755 for files like scripts, providing owner full control and read-execute for others, ensuring broad accessibility without write privileges. A leading fourth digit, if present, controls special permission bits: 4 for (allowing execution as the file owner), 2 for setgid (execution as the file group), and 1 for the (restricting deletion in shared directories). For instance, 4755 enables on an executable while maintaining standard 755 permissions, resulting in rwsr-xr-x. These special bits prepend to the standard three-digit mode and are omitted if not needed (equivalent to 0). Octal notation's advantages include its conciseness, making it ideal for scripting and automation where permissions must be set precisely and compactly, such as in deployment scripts or files. Its direct mapping to binary representation—where each digit aligns perfectly with three bits—stems from early Unix design choices, facilitating efficient low-level manipulation in . However, it requires recalculating the entire for changes, rendering it less intuitive for incremental adjustments compared to other methods.

Symbolic Notation

Symbolic notation in the chmod command enables targeted modifications to file permissions through a descriptive string format that specifies affected users, the type of change, and the permissions involved. The basic syntax is [who][operator][permissions], where the optional who indicates the categories of users affected—u for the owner (), g for the owning group, o for other users, or a for all (equivalent to ugo); omission defaults to a. The operator defines : + adds the specified permissions (without removing others), - removes them (without affecting others), and = sets exactly those permissions for the category, revoking any not explicitly listed. Permissions are denoted by r for read, w for write, and x for execute, which can be combined in any order. Additionally, special permissions include s to set the bit (with u) or setgid bit (with g), allowing execution with elevated privileges, and t to set the (typically with o or a on directories), restricting by non-owners. Common examples illustrate its practical application. The mode u+x adds execute permission solely to the owner, preserving existing read and write access for the owner while leaving group and other permissions untouched. In contrast, go-rwx removes all read, write, and execute permissions from both the group and others, effectively restricting for non-owners. For setting permissions explicitly, a=rw assigns read and write to everyone but revokes execute for all categories, resulting in -rw-rw-rw- . To set special bits, u+s enables the bit, and +t sets the on a . Chaining allows multiple operations within one mode string, separated by commas, to perform complex adjustments efficiently. For example, u+x,go=rx first adds execute to the owner and then sets read and execute (but not write) for group and , yielding -rwx-r-x-r-x. The = operator's behavior is key here: it resets the specified category to only the listed permissions, ignoring prior state; for instance, in the chained example, go=rx removes write from group and even if it was previously set, but does not alter the owner's permissions unless separately specified. Unmentioned categories remain unchanged in all cases. Special bits can also be included in chained modes, such as u=rwxs,g=rx to set owner read/write/setuid and group read/execute. This notation excels in precision for partial or incremental changes, as the operators enable modifications relative to current permissions without needing to specify the full set. Its letter-based structure also enhances human readability, making it preferable for scripts or commands where intent clarity is valuable over absolute numeric specification.

Options

Core Options

The core options of the chmod command modify its default behavior by controlling output verbosity, error handling, and the scope of permission changes. These options are widely portable across systems and are part of Coreutils implementation. The -v or --verbose option causes chmod to output a diagnostic for every processed, describing whether the permissions were changed or remained unchanged. This provides detailed on the command's actions, useful for scripting or . In contrast, the -c or --changes option functions similarly but limits output to only those files where permissions are actually modified, suppressing messages for files that already have the target permissions. Both options enhance transparency without altering the core permission-setting mechanism. For error suppression, the -f, --silent, or --quiet option prevents chmod from printing error messages when it fails to change permissions on a , such as due to insufficient privileges. This "force" mode allows the command to continue processing other files silently, which is particularly helpful in batch operations where non-critical failures should not halt execution. The -R or --recursive option extends chmod's operation to directories and their entire contents, traversing subdirectories and applying permission changes to all s and subdirectories encountered. However, it does not follow s during traversal, meaning the permissions of the links themselves are not altered; instead, if a is specified directly on the command line, the permissions of the target it points to are changed. This behavior ensures safe without unintended modifications to linked structures, though care must be taken with deep directory hierarchies to avoid prolonged execution times. Combining -R with -v or -c provides verbose reporting on the recursive changes, aiding in monitoring large-scale operations.

Extended Options

The --reference=FILE option in the GNU implementation of chmod sets the mode bits of the specified files to exactly match those of the reference file FILE, without requiring the user to explicitly specify the permission values. This feature is particularly useful for replicating permissions across files or directories in scripts or batch operations where consistency is needed. The -h or --no-dereference option, available in GNU coreutils, instructs chmod to modify the permissions of symbolic links themselves rather than dereferencing them to change the target files' permissions, specifically when symbolic links are encountered during recursive (-R) traversals. Without this option, chmod typically ignores symbolic links in recursive mode and operates on their targets instead. This GNU-specific behavior enhances control over symlink handling in complex directory structures. The --preserve-root option causes chmod to fail if an attempt is made to recursively modify the (/), preventing accidental system-wide permission changes that could render the filesystem unusable. The counterpart --no-preserve-root disables this safeguard, but its use is discouraged for safety reasons. This option applies only to recursive operations and does not affect non-recursive invocations. Platform variants of chmod exhibit differences in symbolic link handling during recursive changes. In BSD-derived systems like , the -H, -L, and -P options provide explicit control over dereferencing and traversal. The -H option follows symbolic links named on the command line but does not follow those encountered during . The -L option follows all symbolic links, applying changes to the pointed-to files and recursing through them. The -P option (default when -R is used without -L or -H) avoids following any symbolic links, treating them without dereferencing. coreutils also supports -H, -L, and -P for similar traversal control, while -h provides additional granularity for acting directly on symlink permissions rather than targets. These options allow precise behavior tailored to symlink-heavy environments.

Usage Examples

Basic Operations

The chmod command enables users to modify file permissions in Unix-like systems by altering the read (r), write (w), and execute (x) bits for the owner, group, and others. Basic operations typically involve applying changes to a single file or using either or symbolic notation, as defined in the standard. These adjustments ensure appropriate without affecting multiple targets or invoking advanced options. To set full access for the owner while denying it to group and others, the command chmod 700 private_file assigns read, write, and execute permissions (rwx) exclusively to the owner, represented by the octal value 700 (7 for owner, 0 for group, 0 for others). In a typical terminal session under a Bash environment, assuming private_file initially has default permissions of 644 (-rw-r--r--), the process unfolds as follows:
$ ls -l private_file
-rw-r--r-- 1 user group 0 Nov  8 12:00 private_file
$ chmod 700 private_file
$ ls -l private_file
-rwx------ 1 user group 0 Nov  8 12:00 private_file
This change restricts access, making the file private to its owner. Verification can be performed using ls -l, which displays the permission string -rwx------, or the stat command for detailed mode bits:
$ stat private_file
  File: private_file
  Size: 0         	Blocks: 0          IO Block: 4096   regular empty file
Device: fd00h/64768d	Inode: 1234567     Links: 1
Access: (0700/-rwx------)  Uid: ( 1000/   user)   Gid: ( 1000/   group)
To make a script executable, the symbolic notation chmod +x script.sh adds the execute (x) permission for the owner, group, and others to an existing file, such as a shell script initially set to 644 (-rw-r--r--). The + operator appends the permission without removing others. In a terminal demonstration:
$ ls -l script.sh
-rw-r--r-- 1 [user](/page/User) group 42 Nov  8 12:00 script.sh
$ chmod +x script.sh
$ ls -l script.sh
-rwxr-xr-x 1 [user](/page/User) group 42 Nov  8 12:00 script.sh
Post-change, the file can be run directly (e.g., ./script.sh), and ls -l confirms the updated string -rwxr-xr-x. The stat output would reflect Access: (0755/-rwxr-xr-x). For granting read access to the group, chmod g+r shared.txt appends the read (r) permission specifically to the group category using symbolic notation, leaving owner and others unchanged. Assuming shared.txt starts with 600 (-rw-------), the terminal interaction is:
$ ls -l shared.txt
-rw------- 1 user group 100 Nov  8 12:00 shared.txt
$ chmod g+r shared.txt
$ ls -l shared.txt
-rw-r----- 1 user group 100 Nov  8 12:00 shared.txt
This allows group members to read the file while the owner retains full control. Verification via ls -l shows -rw-r-----, or stat shared.txt provides Access: (0640/-rw-r-----). These operations exemplify fundamental permission tuning for and in single-file contexts.

Advanced Scenarios

In advanced scenarios, the recursive option -R allows chmod to apply permission changes to a directory and all its contents, including subdirectories and files, which is essential for managing permissions across entire structures. For instance, executing chmod -R 755 /project sets the owner to read, write, and execute (rwx), while granting read and execute (rx) to group and others for /project itself and every file and subdirectory within it, ensuring consistent without manual intervention on each item. This operation traverses the directory tree depth-first, modifying modes as it encounters each entry, but it requires execute permission on the starting directory and appropriate or root privileges for the targets. Symbolic links introduce complexity in permission changes, as chmod by default dereferences them and modifies the target file's rather than the link itself. For example, chmod 644 link_to_file alters the permissions of the file pointed to by link_to_file to read and write for the owner (rw) and read-only (r) for group and others. However, specifying the -h (or --no-dereference) option changes the of the symbolic link directly, which sets its apparent permissions—though symlink modes are largely ignored by the system, as access is governed by the target's permissions—allowing explicit in scripts or when avoiding unintended target modifications. Without -h, recursive operations like -R skip symbolic links encountered during traversal and do not follow them, thus not affecting their targets. Symlinks specified on the command line are dereferenced separately. For bulk operations on large sets of files, chmod integrates effectively with the find command to target specific types or patterns across trees, enabling precise permission adjustments without affecting unrelated items. A common example is find /dir -type f -exec chmod 644 {} \;, which locates all regular s (-type f) in /dir and its subdirectories, then executes chmod 644 on each, setting owner read/write and group/others read-only to standardize non-executable access. This approach leverages find's traversal capabilities for efficiency in environments with thousands of s, where direct might be overly broad, and the -exec clause ensures atomic changes per . Setting special permission bits, such as , extends chmod to enable programs to run with elevated privileges, a critical feature for system utilities. The command chmod 4755 /usr/bin/[passwd](/page/Passwd) applies mode 4755, where the leading 4 sets the bit, owner rwx, and group/others rx, allowing non-root users to execute /usr/bin/[passwd](/page/Passwd) with privileges to update password files securely without full administrative access. Even when operating on files owned by the , chmod can encounter "permission denied" errors due to filesystem attributes or restrictions beyond standard . For example, if a file has the immutable flag set via , attempts to modify its mode fail with EPERM, requiring removal of the flag first, as this protects against changes even for the owner or in some contexts. Similarly, mandatory access controls like SELinux or filesystem mount options (e.g., noexec) may block operations, necessitating verification of extended attributes or policies before retrying.

Historical Context

Origins and Evolution

The chmod command originated in the original Unix operating system, developed at Bell Labs starting in 1969 and first released in 1971 by Ken Thompson and Dennis Ritchie. It was included among the more than 60 commands in the initial edition, enabling users to modify file access modes in a multi-user environment from the system's inception. With the release of AT&T Unix Version 7 in 1979, chmod became a foundational utility in the Unix ecosystem, primarily utilizing octal notation to specify absolute permission values. The Seventh Edition Programmer's Manual describes its basic syntax as changing the mode of a file using an octal argument, establishing it as a standard tool for permission management across Unix distributions. Subsequent evolution occurred through variants like the Berkeley Software Distribution (BSD). In 4.3BSD, released in 1986, the command gained the -R option for recursive operation, allowing permissions to be applied across entire directory hierarchies—a feature that addressed growing needs in complex file systems. Meanwhile, key enhancements such as symbolic notation emerged in the , providing a relative way to adjust permissions using descriptors for user, group, and others, alongside operators for addition, removal, or assignment. In System V Release 4 (SVR4) from 1988, further refinements included the recursive flag, aligning AT&T's lineage with BSD capabilities. The modern implementation of chmod is maintained within the GNU coreutils package, which has served as the for and other systems since the 1990s. GNU coreutils introduced options like --reference in the early , enabling the replication of permissions from a to streamline bulk operations.

Standardization

The chmod utility was first formally standardized in POSIX.1-1988 (IEEE Std 1003.1-1988), which specified the core syntax supporting both and modes for setting permissions, along with basic options including -R for recursive application to directories and their contents, and -f to suppress error diagnostics when operations fail due to permissions or other issues. The IEEE Std 1003.1-2008 revision refined the specification, particularly clarifying behavior with symbolic links by allowing implementations flexibility in whether utilities like chmod follow links to modify the target or operate directly on the link itself, thereby accommodating variations while maintaining overall compliance. Implementation differences persist across variants despite POSIX guidelines. In the GNU Coreutils version, prevalent in Linux distributions, chmod by default follows symbolic links and alters the permissions of the referenced target file. Conversely, BSD-derived implementations, such as the one in macOS, default to modifying the symbolic link itself without dereferencing it, requiring the -H option to follow links on the command line. These variances impact cross-platform portability, particularly in scripts or automation involving symbolic links, necessitating explicit option usage or testing on intended environments to ensure consistent outcomes. Linux distributions like and adhere to through Coreutils, providing baseline compliance with extensions for enhanced functionality. macOS, drawing from BSD heritage, employs a POSIX-compliant chmod via its system utilities, though the default symlink handling requires awareness for seamless with GNU-based systems.

Security Aspects

Potential Risks

Improper use of the chmod command can lead to over-permissive file permissions, such as setting mode , which grants read, write, and execute access to the owner, group, and all other users, potentially allowing unauthorized modifications, deletions, or executions that compromise system integrity. This configuration exposes sensitive data to unintended readers and enables malicious alterations by any user, including the injection of harmful scripts. In multi-user environments, such settings violate the principle of and can result in compliance issues with standards like or . Misapplication of permissions, set via modes like 4xxx, poses significant risks by allowing programs to execute with elevated privileges belonging to the file owner, often , which adversaries can exploit for . If a binary contains vulnerabilities, attackers can leverage it to gain unauthorized access, bypassing normal and potentially leading to full system compromise. This danger is heightened when is applied indiscriminately to untrusted or poorly coded executables, as it inherits the owner's capabilities without additional safeguards. The recursive option in chmod amplifies risks by propagating permissive settings across entire directory trees, such as applying 777 to a root-level path, which can inadvertently expose vast portions of the filesystem to unauthorized access or modification. This may break application functionality, corrupt data through concurrent edits, or create pathways for malware persistence across system components. In large-scale environments, such operations can lead to widespread instability if critical files lose necessary restrictions. Common errors in chmod usage include overlooking interactions with the , which masks default permissions for newly created files and can result in inconsistent access controls if not accounted for after permission changes. Additionally, attempting to modify root-owned files without elevated privileges fails with permission denied errors, potentially leaving systems in a partially secured and exposing ongoing vulnerabilities. Historical incidents highlight these risks in contexts, where writable upload directories configured with permissive modes like 777 have enabled attackers to and execute malicious files, leading to remote code execution and data breaches. Such misconfigurations have contributed to high-profile compromises, as noted in misconfiguration analyses, allowing unauthorized takeovers through exploited file features.

Best Practices

When modifying file permissions with chmod, adhere to the principle of least privilege by beginning with restrictive settings, such as for sensitive files (read and write for the owner only), and incrementally granting additional only as necessary to minimize exposure. This approach ensures that users, groups, and others receive no more than required for their tasks, reducing the risk of unauthorized modifications or executions. For precision in permission changes, prefer symbolic mode over octal notation; symbolic commands like chmod u+x file add execute permission only for the user without altering other categories, whereas octal modes like 755 can overwrite all existing settings unintentionally. Symbolic mode is particularly useful for targeted adjustments, such as chmod g-w,o=r directory to remove group write access while setting others to read-only. To maintain accountability, always permission changes by using the verbose (chmod -v) to modifications and cross-verifying with ls -l or commands, which display current permissions in detail. Regular audits, such as running find /path -type f -perm -o+w to locate world-writable files, help identify and correct overly permissive settings promptly. Distinguish between files and directories when setting permissions: use 755 for directories to allow traversal (execute for all) while enabling owner write access, and 644 for regular files to permit reading by all but execution only if explicitly needed. The execute bit on directories enables navigation into contents, whereas on files it allows running scripts or binaries, so avoid it on non-executable files to prevent unintended code execution. Integrate chmod with complementary tools for robust permission management; for instance, combine it with chown to align ownership before applying modes (chown user:group file && chmod 640 file), and set default permissions via umask in shell profiles or scripts (e.g., umask 022 for 644/755 defaults). In automated scripts, test these combinations in non-production environments first to validate behavior across different file types and avoid disrupting live systems.

References

  1. [1]
    chmod(1p) - Linux manual page - man7.org
    The chmod utility shall change any or all of the file mode bits of the file named by each file operand in the way specified by the mode operand.
  2. [2]
    None
    Nothing is retrieved...<|control11|><|separator|>
  3. [3]
    chmod(1) - Linux manual page - man7.org
    DESCRIPTION top. This manual page documents the GNU version of chmod. chmod changes the file mode bits of each given file according to mode, which can be ...
  4. [4]
    chmod(1): change file mode bits - Linux man page
    This manual page documents the GNU version of chmod. chmod changes the file mode bits of each given file according to mode, which can be either a symbolic ...Missing: POSIX | Show results with:POSIX
  5. [5]
    chmod invocation (GNU Coreutils 9.8)
    chmod changes the permissions of the pointed-to file. In contrast, chmod ignores symbolic links encountered during recursive directory traversals.<|control11|><|separator|>
  6. [6]
    chmod - Change the mode of a file or directory - IBM
    chmod changes the access permissions, or modes, of the specified file or directory. (Modes determine who can read, write, or search a directory or file.)
  7. [7]
    File permissions - Cygwin
    Consequently chmod can only affect the "w" mode, it silently ignores actions involving the other modes. This means that ls -l needs to open and read files ...
  8. [8]
    File Permissions for WSL - Microsoft Learn
    Dec 29, 2021 · Chmod will only have one effect, if you remove all the write attributes of a file then the 'read only' attribute on the Windows file will be set ...
  9. [9]
    chmod
    This volume of POSIX. 1-2017 specifies that the S_ISGID bit is cleared by chmod() on a regular file under certain conditions.
  10. [10]
    umask - The Open Group Publications Catalog
    In a symbolic_mode value, the permissions op characters '+' and '-' shall be interpreted relative to the current file mode creation mask; '+' shall cause the ...
  11. [11]
    Linux file permissions explained - Red Hat
    Jan 10, 2023 · In symbolic mode, chmod u represents permissions for the user owner, chmod g represents other users in the file's group, chmod o represents ...
  12. [12]
    chmod - The Open Group Publications Catalog
    DESCRIPTION. The chmod utility shall change any or all of the file mode bits of the file named by each file operand in the way specified by the ...
  13. [13]
    Changing File Permissions
    Only the current owner or superuser can use the chmod command to change file permissions on a file or directory. Change permissions in symbolic mode by using ...<|control11|><|separator|>
  14. [14]
    chmod - The Open Group Publications Catalog
    DESCRIPTION. The chmod utility shall change any or all of the file mode bits of the file named by each file operand in the way specified by the mode operand.
  15. [15]
    chmod(2) - Linux manual page - man7.org
    The chmod() and fchmod() system calls change a file's mode bits. (The file mode consists of the file permission bits plus the set- user-ID, set-group-ID, and ...Synopsis Top · Description Top · Errors Top
  16. [16]
    File permissions (GNU Coreutils 9.8)
    ### Summary of Numeric Modes (Octal Notation) for chmod
  17. [17]
    None
    Nothing is retrieved...<|control11|><|separator|>
  18. [18]
    Modify File Permissions with chmod | Linode Docs
    Nov 14, 2023 · This guide will show you how to modify file and directory permissions using chmod for owner, group, and others in Unix systems.Missing: POSIX | Show results with:POSIX
  19. [19]
    chmod Command - IBM
    Exit Status. This command returns the following exit values: Item, Description. 0, The command executed successfully and all requested changes were made. >0, An ...
  20. [20]
    Linux permissions: An introduction to chmod - Red Hat
    Sep 10, 2019 · This manual page documents the GNU version of chmod. chmod changes the file mode bits of each given file according to mode, which can be either ...<|control11|><|separator|>
  21. [21]
  22. [22]
    chmod(1) - Linux manual page
    ### Summary of chmod Operations and Examples (from man page)
  23. [23]
    How to change file permissions in Linux using chmod - Hostinger
    Apr 28, 2025 · To change permissions in Linux, run chmod followed by the new permission setting and the item you want to modify. Read on to learn more ...
  24. [24]
    Linux File Permissions Explained: chmod, chown, umask - StrongDM
    May 21, 2025 · The recursive -R tells chmod to set the permissions for the directory my_dir to 754 (read, write, and execute for the owner; read and execute ...<|control11|><|separator|>
  25. [25]
  26. [26]
    chmod recursive permission on thousands of files
    Jun 18, 2013 · I have this script which at some point needs to change the permissions recursively in a folder which has a few hundred thousand files.
  27. [27]
    Linux File Permissions: Understanding Setuid, Setgid, and the Sticky ...
    Sep 10, 2025 · To set the setuid bit using octal representation, we can add "4" to the front of our standard octal permissions. For example, chmod 4755 ...
  28. [28]
    Chapter 33. advanced file permissions - linux-training.be
    2. Verify the permissions on /usr/bin/passwd. Remove the setuid, then try changing your password as a normal user. Reset the permissions back and try again.
  29. [29]
    'Permission denied' to a file I own? - Server Fault
    Jun 2, 2009 · I have seen things like that when the filesystem has been corrupted, or if you have a failing drive. The fix usually is to run fsck against the filesystem.permission denied for chmod as root - Server FaultPermission denied with chmod 750 even if a user is just added to a ...More results from serverfault.com
  30. [30]
    Fix 'Permission Denied' Error on Linux - LinuxConfig
    Sep 22, 2025 · Learn how to fix the 'Permission Denied' error in Linux by adjusting file permissions, changing ownership, or using root access effectively.
  31. [31]
    History of Unix - Startertutorials
    Jan 20, 2025 · In 1971, the first edition of Unix appeared along with the B compiler. It consisted of more than 60 commands including cat, chdir, chmod, chown, ...
  32. [32]
    [PDF] unix programmer's manual - Bitsavers.org
    An introduction to TROFF for those who really want to know such things. v. Page 7. CONTENTS. Programming 245 ... CHMOD . 0 CHOWN o CHGRP o MKDIR o RMDIR o CD.
  33. [33]
    [PDF] Bug Fixes and Changes in 4.3BSD April 15, 1986
    Apr 15, 1986 · chgrp. An option has been added for recursively changing the group of a directory tree. chmod. Can now recursively modify the permissions on a ...
  34. [34]
    GNU Core-utils: chmod invocation
    Dec 28, 2002 · Verbosely describe the action or non-action taken for every file . ` --reference= ref_file ': Change the mode of each file to be the same as ...
  35. [35]
    Data Sharing Risks - CRC Documentation - NYU
    Risks of Using chmod 777​​ Data Integrity Issues: Multiple users editing or deleting critical files at once can cause file or directory conflicts or instability. ...
  36. [36]
    Abuse Elevation Control Mechanism: Setuid and Setgid
    Jan 30, 2020 · An adversary may abuse configurations where an application has the setuid or setgid bits set in order to get code running in a different (and possibly more ...Missing: risks | Show results with:risks
  37. [37]
    Setuid and Setgid (T1548.001) - | CISA
    Description. An adversary may abuse configurations where an application has the setuid or setgid bits set in order to get code running in a different (and ...
  38. [38]
    Unix File Permissions - NERSC Documentation
    chmod¶. The chmod ("change mode") command is used to change the permission flags on existing files. ... The chmod command specifies read-write-execute permissions ...Brief Overview · Useful File Permission... · ChmodMissing: POSIX | Show results with:POSIX
  39. [39]
    Using UNIX Permissions to Protect Files
    The chmod command enables you to change the permissions on a file. You must be superuser or the owner of a file or directory to change its permissions. You can ...
  40. [40]
    Unrestricted File Upload - OWASP Foundation
    The consequences of unrestricted file upload can vary, including complete system takeover, an overloaded file system or database, forwarding attacks to back- ...Weak Protections And... · Deny Listing File Extensions · Prevention Methods...
  41. [41]
    A05 Security Misconfiguration - OWASP Top 10:2025 RC1
    90% of applications were tested for some form of misconfiguration, with an average incidence rate of 4.51%, and over 208k occurrences of a Common Weakness ...Description · How To Prevent · Example Attack Scenarios
  42. [42]
    Mastering Linux File Permissions and Ownership
    Apr 1, 2025 · Best Practices for Managing Permissions · Use the principle of least privilege – grant only the necessary permissions. · Avoid using chmod 777 ...Mastering Linux File... · Why File Permissions And... · Special Permission Bits
  43. [43]
    How to Set Permissions in Linux: A Guide to chmod and chown
    May 7, 2025 · Learn how to set file and directory permissions in Linux using chmod, chown, and chgrp. Understand permission codes like 755 and 777.