Question

In: Computer Science

File permissions let us control who can: a. change how files are executed only b. create...

File permissions let us control who can:

a.

change how files are executed only

b.

create files only

c.

delete files only

d.

read, write, and execute a file

Solutions

Expert Solution

Basic File Permissions

Permission Groups

Each file and directory has three user based permission groups:

  • owner – The Owner permissions apply only the owner of the file or directory, they will not impact the actions of other users.
  • group – The Group permissions apply only to the group that has been assigned to the file or directory, they will not effect the actions of other users.
  • all users – The All Users permissions apply to all other users on the system, this is the permission group that you want to watch the most.

Permission Types

Each file or directory has three basic permission types:

  • read – The Read permission refers to a user’s capability to read the contents of the file.
  • write – The Write permissions refer to a user’s capability to write or modify a file or directory.
  • execute – The Execute permission affects a user’s capability to execute a file or view the contents of a directory.

Viewing the Permissions

You can view the permissions by checking the file or directory permissions in your favorite GUI File Manager (which I will not cover here) or by reviewing the output of the “ls -l” command while in the terminal and while working in the directory which contains the file or folder.

The permission in the command line is displayed as: _rwxrwxrwx 1 owner:group

  1. User rights/Permissions
    1. The first character that I marked with an underscore is the special permission flag that can vary.
    2. The following set of three characters (rwx) is for the owner permissions.
    3. The second set of three characters (rwx) is for the Group permissions.
    4. The third set of three characters (rwx) is for the All Users permissions.
  2. Following that grouping since the integer/number displays the number of hardlinks to the file.
  3. The last piece is the Owner and Group assignment formatted as Owner:Group.

Modifying the Permissions

When in the command line, the permissions are edited by using the command chmod. You can assign the permissions explicitly or by using a binary reference as described below.

Explicitly Defining Permissions

To explicity define permissions you will need to reference the Permission Group and Permission Types.

The Permission Groups used are:

u – Owner

g – Group

o – Others

a – All users

The potential Assignment Operators are + (plus) and – (minus); these are used to tell the system whether to add or remove the specific permissions.

So for an example, lets say I have a file named file1 that currently has the permissions set to _rw_rw_rw, which means that the owner, group and all users have read and write permission. Now we want to remove the read and write permissions from the all users group.

To make this modification you would invoke the command: chmod a-rw file1
To add the permissions above you would invoke the command: chmod a+rw file1

As you can see, if you want to grant those permissions you would change the minus character to a plus to add those permissions.


Related Solutions

Create a file and change the file permissions to (a) make it executable, (b) enable the...
Create a file and change the file permissions to (a) make it executable, (b) enable the SUID, and (c) use the ACL to add a permission for the root user. Do a long listing of this file. LINUX command line / virtual box.
How can bias change results in a study? How can buy us influence a person who...
How can bias change results in a study? How can buy us influence a person who wants to conduct a study? What key things can you look for when conducting a study to eliminate bias?
describe how the sense of control (primary vs secondary) can change with aging
describe how the sense of control (primary vs secondary) can change with aging
How would you deal with a patient who was non-compliant? For example, let us say that...
How would you deal with a patient who was non-compliant? For example, let us say that you see a patient and within your scope of practice develop a treatment, therapy, or provide education for this patient. On this patient's next visit, you discover they've followed none of your advice. How would you proceed?
How can bias change results in a study? How can bias influence a person who wants...
How can bias change results in a study? How can bias influence a person who wants to conduct a study? What key things can you look for when conducting a study to eliminate bias?
How can bias change results in a study? How can bias influence a person who wants...
How can bias change results in a study? How can bias influence a person who wants to conduct a study? What key things can you look for when conducting a study to eliminate bias?
In bash how can I read an input file and create variables for specific lines and...
In bash how can I read an input file and create variables for specific lines and columns from the input file? For example I have Q W E R T Y U I A S D F So if I wanted to make a variable where Variable = U, how would I create it.
How can I use Python without Pandas to create a new.csv file with the headers "c1,...
How can I use Python without Pandas to create a new.csv file with the headers "c1, c2, c3, c4, c5, c6" and the first line of data "8, 5, -9, 7, 2.1, 1.7" from the original.csv file?
What is sociological imagination? How can using the sociological imagination give us the power to change...
What is sociological imagination? How can using the sociological imagination give us the power to change the world? Give a suitable example.
Language:c++ choice b and c dont display the file rearranged why is that and how can...
Language:c++ choice b and c dont display the file rearranged why is that and how can i fix it? #include<iostream> #include <fstream> using namespace std; #define size 10000 // Displays the current Inventory Data void Display(int box_nums[], int nboxes[], double ppBox[], int n) // Prints Box number , number of boxes and price per box. {    cout << "Box number Number of boxes in stock Price per box" << "\n";    cout << "-------------------------------------------------------------\n";    for (int i =...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT