Page 1 of 1

Exercise C (Create a directory and put some files into it. Then play about with removing various permissions from yourse

Posted: Tue Jul 12, 2022 8:21 am
by answerhappygod
Exercise C Create A Directory And Put Some Files Into It Then Play About With Removing Various Permissions From Yourse 1
Exercise C Create A Directory And Put Some Files Into It Then Play About With Removing Various Permissions From Yourse 1 (46.36 KiB) Viewed 30 times
Exercise C Create A Directory And Put Some Files Into It Then Play About With Removing Various Permissions From Yourse 2
Exercise C Create A Directory And Put Some Files Into It Then Play About With Removing Various Permissions From Yourse 2 (46.36 KiB) Viewed 30 times
Exercise C Create A Directory And Put Some Files Into It Then Play About With Removing Various Permissions From Yourse 3
Exercise C Create A Directory And Put Some Files Into It Then Play About With Removing Various Permissions From Yourse 3 (28.27 KiB) Viewed 30 times
Exercise C Create A Directory And Put Some Files Into It Then Play About With Removing Various Permissions From Yourse 4
Exercise C Create A Directory And Put Some Files Into It Then Play About With Removing Various Permissions From Yourse 4 (35.92 KiB) Viewed 30 times
Exercise C (Create a directory and put some files into it. Then play about with removing various permissions from yourself on that directory and see what you can and can't do): File ownership is an important component of LINUX that provides a secure method for storing files Every file and directory in LINUX has the following attributes: Owner permissions: The owner's permissions determine what actions the owner of the file can perform on the file. Group permissions: The group's permissions determine what actions a user, who is a member of the group that a file belongs to, can perform on the file. Other (world) permissions: The permissions for others indicate what action all other users can perform on the file. The permissions can be granted or denied to these three classes of users FILE AND DIRECTOEY ACCESS MODES: 1. Read:Grants the capability to read ie. view the contents of the file and directory. 2. Write:Grants the capability to modify, or remove the content of the file and directory 3. Execute:User with execute permissions can run a file as a program.But in case of directory, it does not mean anything only traverse permission. They are represented as: • • • File Type rWXr Xr Permission for the owner Permission of the of file group to which the files belongs 1 X Permission for the rest of users CHANGING PERMISSIONS: To change file or directory permissions, you use the chmod (change mode) command. There are two ways to use chmod: symbolic mode and absolute mode Using chmod in symbolic mode: The easiest way for a beginner to modify file or directory permissions is to use the symbolic mode. With symbolic permissions you can add, delete, or specify the permission set you want by using the operators in the following table.
Chmod operator + u 2 0 user 0 1 2 3 group other 7 all read write execute Description Adds the designated permission(s) to a file or Using chmod with Absolute Permissions: The second way to modify permissions with the chmod command is to use a number to specify each set of permissions for the file. directory. Removes the designated permission(s) from a file or directory. Sets the designated permission(s). Each permission is assigned a value, as the following table shows, and the total of each set of permissions provides a number for that set. Number Octal Permission Representation No permission Execute permission Write permission Execute and write permission: 1 (execute) +2 (write) = 3 Read permission Read and execute permission: 4 (read) + 1 (execute)-5 Read and write permission: 4 (read) + 2 (write) = 6 All permissions: 4 (read) + 2 (write) + 1 (execute) = 7 Ref --X -W- -WX I-X TW- TW
CHANGING OWNERS AND GROUPS: While creating an account on Unix, it assigns a owner ID and a group ID to each user. All the permissions mentioned above are also assigned based on Owner and Groups. Two commands are available to change the owner and the group of files: 1. chown: The chown command stands for "change owner" and is used to change the owner of a file. 2. chgrp: The chgrp command stands for "change group" and is used to change the group of a file. Changing ownership: The chown command changes the ownership of a file. syntax: $ chown user filelist The value of user can be either the name of a user on the system or the user id (uid) of a user on the system. Changing Group Ownership: The chrgp command changes the group ownership of a file. syntax: $ chgrp group filelist