📖 What is chmod (Change Mode)?
chmod (Change Mode) is a Linux command used to change the access permissions of file system objects. It defines who can read, write, or execute a file, typically using numeric octal values or symbolic representations to set permissions.
"Study the octal values: 4 for read, 2 for write, and 1 for execute. A value of 777 means everyone has full access to the file."
📚 Certification: CompTIA A+ Certification Exam Core 2 (220-1102)
🔑 What are the Key Concepts of chmod (Change Mode)?
- ▸ Octal values represent permissions: 4 for read, 2 for write, and 1 for execute, which are summed to create a single digit for each user class.
- ▸ Permissions are applied to three distinct entities: the file owner (user), the assigned group, and all other users (world) on the system.
- ▸ Symbolic mode uses characters like 'u', 'g', 'o', and 'a' combined with '+' or '-' to add or remove specific permissions without changing others.
- ▸ The execute bit is essential for scripts and binaries; without it, the system will refuse to run the file as a program regardless of read access.
- ▸ Following the Principle of Least Privilege, chmod is used to restrict access to sensitive system files to prevent unauthorized modification or execution.
🎯 How does chmod (Change Mode) appear on the 220-1102 Exam?
You may be asked to identify the correct command to resolve a 'Permission Denied' error when a user attempts to run a bash script they created.
A scenario might describe a sensitive configuration file with permissions set to 777 and ask you to select the octal value that restricts access to the owner only.
Expect questions where you must translate a symbolic permission change, such as 'chmod g+w', into its practical effect on a file's group access.
❓ Frequently Asked Questions
When should I use symbolic mode instead of numeric mode?
Use symbolic mode when you want to modify a single permission, such as adding write access, without needing to know or overwrite the existing permissions for other users.
Why can't I change permissions on a file I didn't create?
Only the file owner or the root user can change permissions. You must use the 'sudo' command to execute chmod with administrative privileges for files you do not own.