Question

Linux Operation SECTION 2 – File and Directory Permissions: FILE PERMISSIONS: What is the command used...

Linux Operation

SECTION 2 – File and Directory Permissions:

FILE PERMISSIONS:

  1. What is the command used to find out which user account you are logged into?

     . This command may come in handy in the following exercises.

  1. Ensure you are in your home directory of the student1 account. Use the echo command with output redirection to create a file called labfile4 and put the following text in this file: “This is the first line of labfile4”. Using the symbolic notation for permissions, what are the permissions on this file:         .

Ensure the permissions on the labfile4 file and the current directory (sudent1) are read and execute, and not write, for group. Set them with the chmod command if necessary. Su - into the student2 account. As the student2 user, display the contents of the labfile4 file using the cat command. Can you do it?         .

While still logged into the student2 account, attempt to append a second line of text called “This is the second line of labfile4” to the labfile4 file using the echo >> command. Can you do it?        .

Why or why not?        .

While still logged into the student2 account, attempt to set write permission for group on the labfile4 file from the student2 account, using a relative path. What command did you enter?         .

Can you do it?         .

Why or why not?        .

Log out of the student2 account and back into the student1 account and change the permissions on the labfile4 file to include write permission for group, leaving the read and execute access on it. What command did you enter to do this?         .

Why can student1 change permissions on this file?         .

Now su – back into the student2 account. Again attempt to append a second line of text called “This is the second line of labfile4” to student1’s labfile4 file using the echo >> command. Can you do it?         .

Why or why not?        .

  1. Does the owner of a file change when a non-owner successfully writes to the file?         .

DIRECTORY PERMISSIONS:

  1. While in the student1 account, ensure you are in the home directory of the student1 account. Create a new subdirectory called subdir2. What command did you use:

     .

Using the octal notation for permissions, what are the permissions on this directory file:        .

While still in the student1 account, use the echo > command with output redirection, create a file in the subdir2 directory called labfile5 and put the following text in this file: “This is the first line of labfile5”. Ensure the permissions on the subdir2 directory and the subdir2/labdile5 file are read and execute, and not write, for group. Set them with the chmod command if necessary.

Now su – to the student2 account. As the student2 user, ensure you are in your home directory. Display the contents of this labfile5 file using a relative path with the cat command. What command did you use:        .

Can you view this file? (you should be able to…)      .

Attempt to append a second line of text called “This is the second line of labfile5” to the labfile5 file using the echo command with output redirection. Can you do it?        .

Why or why not?        .

Log out of the student2 account and back into the student1 account and change the permissions on the subdir2 directory only, to include write permission, leaving the read and execute access on it. What command did you use?      .

In the student2 account, again attempt to append a second line of text called “This is the second line of labfile5” to the student1’s labfile5 file using the echo >> command. Can you do it?         .

Why or why not?        .

Attempt to delete the labfile5 file from student2 account. Can you do it?         .

Create a file called labfile6 in the subdir2 directory. Can you do it?         .

What three file operations does write permission allow on a directory, even if write is not enabled on files within?

1     .

2     .

3     .

DEFAULT PERMISSIONS (UMASK):

  1. Ensure you are in the home directory of any account (student1 or 2). Create a file called labfile7. What are the permissions on this file, in symbolic notation?        .

Explain in detail, how the permissions got set this way on this file, in regard to umask. Be Specifc. (Also explain why execute is not set on this file)?         .

Create a subdirectory called subdir3. What are the permissions on this directory file, in octal notation?

     .

Explain in detail, how the permissions got set this way on this directory in regard to umask. Be Specifc.

     .

Homework Answers

Answer #1

i could not post answer as its very lengthy so we have limit to post not more than 65,000 characters. so here is the link for the answer

https://www.dropbox.com/s/1fbo3hp6oqku0e6/Answer.docx?dl=0

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Linux, please avocado is an empty file Q14 – Specify a single line command that gives...
Linux, please avocado is an empty file Q14 – Specify a single line command that gives the owner and group permission to execute the file avocado while giving the owner sole permission to read and write the file. Do not change any other permission, i.e., do not remove permission from others to execute the file, if they already have that permission. Q15 – File/directory permissions are subject to permissions on the parent directories. For example, consider the file /home/dv35/cs265/lab1.txt. If...
Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2....
Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2. Create a file with name “yourLastName.txt” inside the directory created in step.1 3. Write inside the created file exactly the following content (you may use editors such as vim, pico, ….): Linux Lab Lab. ToDo#1 Summer Semester 2019/2020# 4. Display the first 2 lines of the file. 5. Change the permission of the file to read write and execute for owner, groups and others....
Provide a single command to grant the following permissions (using decimal numbers) to a file named/called...
Provide a single command to grant the following permissions (using decimal numbers) to a file named/called “final-exam”.   Owner Access: Read, Write, Execute    Group Access: Read, Write     Public Access: Execute
drwxr-xr-x 10 mst staff 320 Sep 18 14:58 Sites drwxr-xr-x 2 mst staff 64 May 28...
drwxr-xr-x 10 mst staff 320 Sep 18 14:58 Sites drwxr-xr-x 2 mst staff 64 May 28 2017 VirtualBox VMs -rw-r--r-- 1 mst staff 633 Dec 11 2019 balance.pl drwxr-xr-x 4 mst staff 128 Oct 11 2014 bin -rw-r--r-- 1 mst staff 473 Dec 13 2019 bitshift.py For this problem, we are mainly concerned with the set of access permissions, which appears at the beginning of the line for each file or directory. Directories have a "d" at the beginning of...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and the output in a word document and submit it. Part1: 1. Log in to Linux using your user account name and password. 2. If you logged in using a graphical login screen, open a terminal window by clicking on the icon in the lower left corner of the desktop to open the main menu, then selecting System Tools, then Terminal. A terminal window opens....
List a sequence of Linux commands you would execute after you successfully log on to your...
List a sequence of Linux commands you would execute after you successfully log on to your VM machine, make a directory called midterm in your home directory, create a simple C program called display.c in the newly created directory, compile the code using gcc compiler, and run the program, and finally, save the output to a text file called display.txt. Remember to briefly explain each command.
5. Write a bash command that will display the name of every file on the Linux...
5. Write a bash command that will display the name of every file on the Linux system whose file contaent contains the string "doug.jones". The command must run in the background, must redirect standard error to /dev/null, and must redirect standard output to ~/out. 6. Write a bash command that will kill all of the even-numbered processes associated with your userid, and no other processes. 7. Write a bash command that will start the program /home/courses/140u-doug.jones/zombie_maker as a background process,...
1. Switch to a command-line terminal (tty5) by pressing Ctrl+Alt+F5 and log in to the terminal...
1. Switch to a command-line terminal (tty5) by pressing Ctrl+Alt+F5 and log in to the terminal using the user name of root and the password of LINUXrocks!. 2. At the command prompt, type vi diskconfig.sh and press Enter to open a new file for editing called diskconfig.sh in your home directory. Why is it good form to use a .sh extension for shell scripts? 3. Enter the following text into the diskconfig.sh file. As you are typing the contents, ensure...
please use linux/unix command terminal to complete, step 1 1-create a new directory named by inlab4...
please use linux/unix command terminal to complete, step 1 1-create a new directory named by inlab4 enter directory inlab4 create a new file named by reverse.c with the following contents and then close the file: /*reverse.c */ #include <stdio.h> reverse(char *before, char *after); main() { char str[100]; /*Buffer to hold reversed string */ reverse("cat", str); /*Reverse the string "cat" */ printf("reverse(\"cat\")=%s\n", str); /*Display result */ reverse("noon", str); /*Reverse the string "noon" */ printf("reverse(\"noon\")=%s\n", str); /*Display result */ } reverse(char *before,...
Step 1: Edit StringExplode.java Download the StringExplode.java file, and open it in jGrasp (or a text...
Step 1: Edit StringExplode.java Download the StringExplode.java file, and open it in jGrasp (or a text editor of your choice). This program will “explode” a String into an array of characters (char[]), and then print out the array. The String comes from the first command-line argument. Example output with the command-line argument foo is below: f o o --------------------------------------------------------------------- public class StringExplode { // TODO - write your code below this comment. // You will need to write a method...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT