To complete this chapter, you can do the following things:
Describes and changes the owners and groups of files.
Describes and changes permissions for a file.
Describes and establishes default permissions for new files.
Describes how to change the identity of users and groups of files.
5.1 File permissions and Access
Accessing a file requires the identity of the user and the permissions associated with the file. This chapter describes how to access files
Permissions to understand the read, write, and execute permissions of files
LS (ll,ls–l) determines the access permissions that the file is granted.
chmod change file access permissions.
Chown changes the owner of a file.
Umask change default file access permissions
CHGRP change the group of a file.
Su transforms your user identity.
NEWGRP Convert your group identity
Each file belongs to a user in the system. The owner of the file decides who has access to the file. The owner of the file has the power to allow or deny other users access to the file.
5.2 Who has access to a file right
The UNIX system provides a three-tier access structure for a file:
User represents the owner of the file
Group represents groups that have access to files
Other represents all other users in the system
Each file belongs to some users in the system. The owner of the file has full control over who has access to the file, and the owner can allow or deny access to the files by other users in his system. The owner decides which group has access to his files, and the owner can transfer the ownership of the file to other users in the system, but once the ownership of the file is converted, the original owner of the file is no longer able to control the file.
Because the file belongs to the user and is associated with the group, you can use the ID command to view your identity and your access to the files in the system.
The owners of the files in the image above are members of the user User3,class group and can access these files, and User3 can allow other users on the system to access the files as well.