Permissions · Lesson 3 of 8
Ownership Permissions
0 / 4 checkpoints answered
Every Linux filesystem object records a user owner and a group owner. These identities determine which owner or group permission triplet applies, but they do not themselves grant a particular permission. Inspect both ownership and mode with ls -l.
Changing the User Owner
Use chown, short for change owner, to assign a different user owner:
$ sudo chown patty myfile
This changes the user owner of myfile to patty and leaves its group unchanged. Changing a file's user owner normally requires appropriate privilege, even if you currently own the file. This restriction prevents users from transferring files to evade quotas or other ownership-based controls.
CheckWhich command changes the user owner of myfile to patty while leaving its group unchanged?
press 1/2/3 to answer · → next lesson
Changing the Group Owner
Use chgrp to assign a different group owner:
$ chgrp whales myfile
On typical systems, an unprivileged owner can change a file's group only to a group of which that user is a member. Privileged processes can make broader changes. The equivalent chown form begins with a colon:
$ chown :whales myfile
Afterward, the group's mode bits apply when the kernel selects the group class; changing the group does not automatically add read, write, or execute bits.
CheckWhat does chgrp whales myfile change?
press 1/2/3 to answer · → next lesson
Changing User and Group Together
Supply USER:GROUP to chown to update both fields in one operation:
$ sudo chown patty:whales myfile
The command assigns patty as the user owner and whales as the group owner. Verify the result rather than assuming it succeeded:
$ ls -l myfile
CheckWhich ownership specification assigns user patty and group whales in one chown command?
press 1/2/3 to answer · → next lesson
Handling Recursive Changes Carefully
The -R option changes ownership recursively, but a broad recursive command can cross unexpected directory trees or affect service data. Confirm the exact target, understand symbolic-link behavior for your implementation, preview the tree, and verify a small sample before changing a large hierarchy. Avoid copying privileged ownership commands from examples onto real systems without reviewing their scope.
CheckAfter changing a file's group owner, what happens to its ordinary group permission bits?
press 1/2/3 to answer · → next lesson
For practice in an isolated environment, the Linux User Group and File Permissions lab covers inspecting and modifying ownership alongside file modes.
Summary
You can now distinguish ownership metadata from permission bits and change it deliberately.
- Use
chown USER FILEto change the user owner. - Use
chgrp GROUP FILEorchown :GROUP FILEto change the group owner. - Use
chown USER:GROUP FILEto set both fields. - Verify results and scope recursive changes carefully.
Lesson complete
You finished Ownership Permissions. Nice work — keep the momentum going.