Question: Project 4 - 9 ESTIMATED TIME: 1 5 minutes OBJECTIVE: Set file and directory ownership. DESCRIPTION: In this hands - on project, you view and
Project
ESTIMATED TIME: minutes
OBJECTIVE: Set file and directory ownership.
DESCRIPTION: In this handson project, you view and change file and directory ownership using the chown and chgrp commands.
Switch to a commandline terminal tty by pressing CtrlAltF and log in to the terminal using the user name of root and the password of LINUXrocks!.
At the command prompt, type touch ownersample and press Enter. Next, type mkdir ownerdir at the command prompt and press Enter. Next, type ls l at the command prompt and press Enter to verify that the file ownersample and directory ownerdir were created and that root is the owner and group owner of each.
At the command prompt, type chgrp sys owner and press Enter to change the group ownership to the sys group for both ownersample and ownerdir. Why were you successful?
At the command prompt, type chown user owner and press Enter to change the ownership to the user user for both ownersample and ownerdir. Why were you successful?
At the command prompt, type chown root.root owner and press Enter to change the ownership and group ownership back to the root user for both ownersample and ownerdir. Although you are not the current owner of these files, why did you not receive an error message?
At the command prompt, type mv ownersample ownerdir and press Enter. Next, type ls lR at the command prompt and press Enter to note that the ownersample file now exists within the ownerdir directory and that both are owned by root.
At the command prompt, type chown R user ownerdir and press Enter. Next, type ls lR at the command prompt and press Enter. Who owns the ownerdir directory and ownersample file?
At the command prompt, type rm Rf ownerdir and press Enter. Why were you able to delete this directory without being the owner of it
Type exit and press Enter to log out of your shell.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
