Question

What chmod command would you use to impose the following permissions? 1. on a directory(called dir1)...

What chmod command would you use to impose the following permissions?

1. on a directory(called dir1) and all its subdirectories such that: the owner would have read, write, and execute; the group would have read and execute; and others would have read(write the command in two ways: using rwx and using numeric value)

2. on file (called file1)such that: the owner would have read and write; the group would have no permissions; and others would have write

(write the command in two ways: using rwx and using numeric value)

3. set the special permission SGID and sticky bit for dir1.(you don't need to change the defined permission in 1)

Starting from the Linux default permissions for file and directories, what umask command would you use to ensure that for all new:

4. directories, the owner would have read, write, and execute; members of the group would have read and execute; and others would have read

5. files, the owner would have read and execute; the group would have read, write, and execute; and others would have execute

Homework Answers

Answer #1

Feel free to upvote if you find this answer useful!

Pre-Step: Setting up the directory structure

1. chmod using rwx and numeric value for directory

2. chmod using rwx and numeric value for file

3a). chmod to set SGID

Notice the s in the output of ls -l in dir1's permissions

3b). chmod to set sticky bit

Notice the T at the end in dir1's permissions

4. Setting umask so that u=rwx,g=rx,o=r

We create dir3 to test if it worked

5. Set umask for files to have u=rx,g=rwx,o=x

Note: The base permissions set by umask for files is 666 (read, write for owner, group and others)

So files cannot be set to executable with umask (unlike directories)

The command below makes u=r,g=rw,o=

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 Operation SECTION 2 – File and Directory Permissions: FILE PERMISSIONS: What is the command used...
Linux Operation SECTION 2 – File and Directory Permissions: FILE PERMISSIONS: 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. 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...
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...
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
Using the octal notation, change the file permissions of mydoc file so that you, the owner...
Using the octal notation, change the file permissions of mydoc file so that you, the owner of the file, have all permissions, the “group” users have read and execute permissions, and “other” users only have read permission.
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....
Write a shell program named HELOO (this should be done linux) Your program should set permissions...
Write a shell program named HELOO (this should be done linux) Your program should set permissions for a file named A1testFile so that the current premissions remain, except execute permissions are REMOVED for everyone, including owner. Your must accomplish this with a single chmod command. A1testFile should be specified as a relative path name to a file in the current directory (the directory the user is in when they run your program). Your program should not display any error messages,...
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...
How would I go about answering these questions In linux. Please provide the correct linux command...
How would I go about answering these questions In linux. Please provide the correct linux command needed to answer these 4 questions 5. Display total words of each file under your root directory and subdirectories. 6. Change permission of every filename ends “.py” to — write read execute, group - read execute, other - execute 7. Find every line which contains “hello” from your file system, display both file name, line number. 8. Combine files with name “p3.py”, “p31.py”, “p32.py”,...
What command would you use to view the files and folders in the C:\windows directory? Use...
What command would you use to view the files and folders in the C:\windows directory? Use relative references. What command would you use to view only the directories in the C:\windows directory? Use relative references. Hint: Use a switch. What command would you use to view only the .com files in the C:\windows\system32 directory? Use relative references. What command would you use to create a directory called JUNK at the root. Use relative references. What command would you use to...
should be in Linux, please Write a shell program named A1L21 Your program should set permissions...
should be in Linux, please Write a shell program named A1L21 Your program should set permissions for a file whose name is given as an argument to your program. The permissions must be changed using a SINGLE chmod command, and must be set to EXACTLY rw for owner and group and x for others. Your program should NOT show any error messages on the screen, even if the given file does not exist, etc.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT