Identify and update file permissions.
Outcomes
Modify file permissions to grant permissions to different sets of users.
As the student user on the workstation machine, use the lab command to prepare your environment for this exercise, and to ensure that all required resources are available.
[student@workstation ~]$ lab start users-permissions
Instructions
In the Files application, navigate to the /Expenses directory.
Review the file permissions of the /Expenses/July directory.
Open the Files application, click , and then select .
Double-click the Expenses directory.
Right-click the July directory, and select from the context menu.
Click to review the directory permissions.
The student user has read, write, and execute permissions on the directory.
The group and others user sets do not have permissions for this directory.
On the command line, review the permissions on the /Expenses/July directory.
Grant the Operations group permissions to read and write in the /Expenses/July directory and its contents.
Maintain the current rwx permission set for the user, and maintain the --- permission set for the others.
Use sudo privileges with the chmod command to set the new permissions.
On the command line, review the permissions of the /Expenses/July directory.
[student@workstation ~]$ ls -ld /Expenses/July/
drwx------. 2 student Operations 152 Nov 5 22:14 /Expenses/July/Review the permissions of the files in the /Expenses/July directory.
[student@workstation ~]$ ls -l /Expenses/July/
total 0
-rw-------. 1 developer2 Operations 0 Nov 5 22:53 developer2_expenses.txt
-rw-------. 1 developer3 Operations 0 Nov 5 22:53 developer3_expenses.txt
-rw-------. 1 manager Operations 0 Nov 5 22:53 manager_expenses.txt
-rwxr--r--. 1 student Operations 0 Nov 5 22:53 review_files.sh
-rw-rw-rw-. 1 student Operations 0 Nov 5 22:53 student_expenses.txt
-rw-------. 1 tester2 Operations 0 Nov 5 22:53 tester2_expenses.txtGrant the Operations group permission to read and write on the /Expenses/July directory.
Maintain the current rwx permission set for the user, and maintain the --- permission set for the others
[student@workstation ~]$chmod 0760 /Expenses/July/[student@workstation ~]$ls -ld /Expenses/July/drwxrw----. 2 student Operations 152 Nov 5 22:14 /Expenses/July/
The /Expenses/July/student_expenses.txt file has read and write permissions for all users.
Set the appropriate permissions to the /Expenses/July/student_expenses.txt file so that only the student user can write to the file.
Review the permissions on the student_expenses.txt file.
[student@workstation ~]$ ls -l /Expenses/July/student_expenses.txt
-rw-rw-rw-. 1 student Operations 0 Nov 5 22:53 /Expenses/July/student_expenses.txtSet the permissions so that only the student user can write the file.
[student@workstation ~]$chmod 0600 /Expenses/July/student_expenses.txt[student@workstation ~]$ls -l /Expenses/July/student_expenses.txt-rw-------. 1 student Operations 0 Nov 5 22:53 /Expenses/July/student_expenses.txt
Set the appropriate permissions for the /Expenses/July/review_files.sh script so that all users in the system can execute it.
Review the permissions on the review_files.sh file.
[student@workstation ~]$ ls -l /Expenses/July/review_files.sh
-rwxr--r--. 1 student Operations 0 Nov 5 23:02 /Expenses/July/review_files.shSet the permissions so that all users can execute the review_files.sh script.
[student@workstation ~]$chmod 755 /Expenses/July/review_files.sh[student@workstation ~]$ls -l /Expenses/July/review_files.sh-rwxr-xr-x. 1 student Operations 0 Nov 5 23:02 /Expenses/July/review_files.sh