Final answer:
To change ownership of the /hr directory to user bcassini and group hr, use the chown command. To then change the group ownership of the /hr/personnel file to mgmt1, use the chgrp command.
Step-by-step explanation:
During a security audit, if you find that the ownership of the /hr directory is incorrect, you can change it using Linux command-line tools. To give Brenda Cassini (bcassini) ownership of the /hr directory and all of its contents, you would use the chown command recursively:
sudo chown -R bcassini /hr
Next, to give the hr group ownership of the same directory and all of its contents, the chgrp command or the chown command can again be used recursively:
sudo chown -R :hr /hr
or
sudo chgrp -R hr /hr
Finally, to return group ownership of the /hr/personnel file to mgmt1, without changing the owner, you would use the chgrp command:
sudo chgrp mgmt1 /hr/personnel
To give ownership of the /hr directory and all of its contents to Brenda Cassini (bcassini), you can use the chown command with the -R option to recursively change the ownership:
chown -R bcassini /hr
To give group ownership to the hr group, you can use the chgrp command with the -R option:
chgrp -R hr /hr
To reset the group ownership on the /hr/personnel file to mgmt1, you can use the chgrp command:
chgrp mgmt1 /hr/personnel