Permission Management in CentOS7#
drwxr-xr-x root root abc
d/-/l | rwx | r-x | r-x |
---|---|---|---|
Type d: directory -: file l: symbolic link | Owner permissions (u) r: read w: write x: execute | Group permissions (g) | Other permissions (o) |
drwxr-xr-x | root | root | abc |
---|---|---|---|
File type and permissions | Owner | Group | File (folder) name |
logout # Log out the current user
Two commands related to permissions:
- Change permission command:
chmod
- Change owner/group:
chown
For example:
Now there is a file with detailed information:
drwxr-xr-x root root student
Now you want to add read permission for the abc user
Since the user is neither the root user nor in the root group
So, look at the last group of permissions
chmod o+w student
Or change the owner and group
chown abc:root
Another example:
Now you want to change the student directory to the following permissions
drwx------ abc abc student
# Modify permissions using binary method
rwx --- ---
111 000 000
chmod 700 student