In this lab, you will practice creating user and group accounts. You will also start using file permissions to control access to files and directories.
Creating accounts and groups requires superuser privilege, so those commands will require the use of sudo
. Once you have created users, you will be perorming tasks as those users, so for those tasks, you will be required to login as those users. For this purpose, it is recommended that in a terminal window, you use
login username
to start a login shell as the desired user in that window. When you are done running commands as that user, you can use the
logout
command to return to the shell you were using before you entered the login username
command.
sudo addgroup developers
sudo mkdir -p /projects/bigdeal/incoming
sudo chgrp -R developers /projects/bigdeal
sudo chmod -R 2770 /projects/bigdeal
sudo adduser harry
sudo adduser sally
sudo adduser cupid
sudo adduser harry developers
sudo adduser sally developers
sudo adduser cupid developers
login harry
nano myclothes.txt
cp myclothes.txt /projects/bigdeal/incoming/harry
logout
login sally
nano myfurniture.txt
cp myfurniture.txt /projects/bigdeal/incoming/sally
logout
login cupid
paste
command, create a file called when-harry-met-sally.txt in /projects/bigdeal by pasting together the two files harry and sally and use redirection to put the output into the incoming directory.
cd /projects/bigdeal/incoming
paste harry sally > ../when-harry-met-sally.txt
rm harry sally
cat
to display the contents of the when-harry-met-sally.txt file.
cd ..
cat when-harry-met-sally.txt
logout
Capture screenshots of the terminal window showing your prompt, commands, and as much of the output for each command as fits in the window with your command still showing. Submit a single PDF file to blackboard containing your screenshots in the order they were performed, along wityh your responses to the questios asked in the lab.