Question

In: Computer Science

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

Solutions

Expert Solution

Please like the answer if you find it satisfying or please leave a comment i will repy to it.

1)

what you really want to do is set the directories to 755 and either leave the files alone or set them to 644. For this, you can use the find command. For example:

To change all the directories to 755 (drwxr-xr-x):

find /opt/lampp/htdocs -type d -exec chmod 755 {} \;

To change all the files to 644 (-rw-r--r--):

find /opt/lampp/htdocs -type f -exec chmod 644 {} \;

2) chmod 640 file1, which means that the owner has read and write permissions, the group has read permissions, and all other user have no rights to the file.

to set a file to permissions on file1 to read _rwxr_____, you would enter chmod 740 file1.

3)

When the SGID bit is set on an executable file, the effective group is set to the group of the file. The process runs with the permissions of the members of the file’s group, rather than the permissions of the person who launched it.

sudo chown root:mary /usr/local/bin/htg
sudo chmod u-s,g+s /usr/local/bin/htg
ls -lh /usr/local/bin/htg

You can see the SGID bit denoted by the “s” in the group permissions.

The Sticky Bit

When you set the sticky bit on a directory, people can only delete files that belong to them within that directory. They can’t delete files that belong to someone else, no matter which combination of file permissions are set on the files.

mkdir shared
sudo chmod o+t shared
ls -lh -d shared
ls -lh -d /tmp
ls -lh -d /var/tmp

Related Solutions

What are the permissions for your home directory set by your system administrator? What command did...
What are the permissions for your home directory set by your system administrator? What command did you use to answer the question? Show your session.
1. What command is used to change the current working directory at the command line?
1. What command is used to change the current working directory at the command line?
- What SQL command would you use to make a table for products that includes three...
- What SQL command would you use to make a table for products that includes three columns: a product’s ID, a product’s cost, and a product’s selling price? - What SQL command would you use to make a table for telephone directory that contains a person’s full name, a person’s cellphone number, and a person’s home phone number? - What SQL command would you use to make a table for an inventory of network equipment that includes the following: the...
1. In terms of security, why would you not use rm command to delete files? 2....
1. In terms of security, why would you not use rm command to delete files? 2. Shred and dd are tools used to securely delete files. Which is the best tool for securely deleting a file from a system and why? Consider the limitations of each tool when choosing your answer. 3. What encryption is used to encrypt HTTP traffic (HTTPS)? 4. The CIA triad , confidentiality, integrity, and availability represent the three goals for cybersecurity. Which goal(s) does/do encryption...
Linux Use touch to create a file in your working directory called PutFileHere this is a...
Linux Use touch to create a file in your working directory called PutFileHere this is a linux question i acidentally put javascript when i first submitted it
Use Kali Linux Commands to show me the following: 1. Who are you? 2. Change directory...
Use Kali Linux Commands to show me the following: 1. Who are you? 2. Change directory to Downloads 3. Make a new directory 4. Make a new text file under your name (Ghada.txt) 5. Write a paragraph about Cyber security (4 to 5 sentences) >>simply open the file and write inside it 6. Change the permission to be 764 7. Open the file but with a cyber security match Show me each and every step with figure b. Enter into...
1. Compare the Unix directory and the windows directory and answer the following: a. Match 3...
1. Compare the Unix directory and the windows directory and answer the following: a. Match 3 Unix directories to a Windows directory that is similar in function. Briefly describe their similarities and differences. b. Find a directory in Unix that appears to have no equivalent in Windows. What does it do? c. Find a directory in Windows that appears to have no equivalent in Unix. What does it do?
What is the difference between IP and MAC address on a PC? What command would you...
What is the difference between IP and MAC address on a PC? What command would you type that will give you both IP and MAC information.
1. At the command prompt, use the where command to locate the where.exe file. Copy and...
1. At the command prompt, use the where command to locate the where.exe file. Copy and paste the full path and filename for the where.exe file into the space provided below. 2. At the command prompt, enter the following command and press enter. find "free beer" "c:\Program Files (x86)\Notepad++\*.txt" This command searches for the string "free beer" in all .TXT files in the Notepad++ program folder. According to the output of the find command, which of the files listed below...
You first needs to create a file called “myJS.js” in your project directory. Then, include the...
You first needs to create a file called “myJS.js” in your project directory. Then, include the AngularJS library and myJS.js in the header of the index.html page. Now, you need to define your angular application and a controller in this file such that the controller has the following variables with these initial values: name = "Alex Cool"; faculty= "Faculty of Busienss and IT"; university = {name:"University of Ontario Institute of Technology", url:"http://www.uoit.ca"}; contacts = {email:"[email protected]", phone:"xxx-xxx-xxxx"}; skills = [ {name:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT