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
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=
Get Answers For Free
Most questions answered within 1 hours.