please read attached file
Full Name: _________________________________ Date/Time Started: __________ CSEC 378/418 – Lab 1 Deliverable and Instructions: This lab will guide you through the configuration and management of your Linux system. This lab begins once you are already connected to your Linux host through the Netlab environment. For instructions on how to get connected to the Netlab environment, please consult the Lab Connectivity Guide on D2L. During the course of this lab you will create a user with a username consisting of your first initial and last name - i.e. knaughton. Throughout this lab when you see the term yourname, I am referring to this user account. Substitute it in commands accordingly with the correct username. Please do not create a user actually named “yourname”. I use the presence of your username in screenshots to validate that the screenshots are your own, and you will not receive credit if you do not have a unique username. The submission file for this lab will be a pdf version of this document, with your answers and screenshots added. Each correctly answered question will count for 1 point. Each screenshot will also count for 1 point and will be evaluated on whether it fully meets the requirements of the screenshot prompt. Your score will be determined by the percentage of total questions and screenshot prompts answered correctly. Answer the questions below the prompts indicated in green. If the question is multi-part, you must answer all parts correctly to receive the point for that question. No partial credit will be given. Add screenshots below the prompts indicated in green. When adding screenshots to the document, include both the command itself (when applicable), as well as the output or requested information. Ensure that each screenshot is readable in-line in the submission document. If I am unable to read the contents of your screenshot in the document because it is too large of a screenshot, it will not count for credit. Do not include screenshots of your whole desktop or whole terminal window to when the prompt is asking about one single command. *** Writing in Blue use as reference only *** For this assignment use Linux Section 1: File & Directory Management Step 1: Use the Netlab environment to access your “Linux Server 1” machine as the student user. You will not need to use any of the Windows machines for this lab. They will be used in a future lab. Login with the username student and the password student. Once logged in you will see a prompt similar to the one below. ** Pretend is your computer and the command and the bottom picture comes out ** This one and answer the questions below. Question 1.1: What do the different components of the prompt mean? Explain each part of the prompt. Question 1.2: By looking at this prompt are you a normal user or a super user? How do you know? Step 2: Enter the date command by typing date into the shell prompt. Post a screenshot of the output of the command. Step 3: Use the passwd command to change the password of the student user you are logged in as. Just enter the passwd command with no arguments to change the password of the user you are logged in as. Step 4: When prompted, enter the current password for the student account. Step 5: When asked to enter a new password enter the password CSEC378418! And then enter it again to finish changing this password. Step 6: Create a new file with the touch command. touch is a command that can be used to update the timestamp on an existing file or create a blank new file if used on a filename that doesn’t already exist. Use the touch command to make a file called eandujar.txt Step 7: Use the ls (list) command to list the contents of your current directory and post a screenshot of the output of the command. You should be able to see the file you just created. Step 8: Use the file command this new file and post a screenshot of the output below. Question 1.3: What does the file command you used in the last step tell you about the file you specified? Step 9: Lets add some contents to the file you just created. One of the quickest ways to do this is to use a command called echo. echo is a utility that will take whatever input you give it and echo it back to you. Try running the command echo hello world and see what happens. Step 10: echo takes text in via standard input (stdin) and spits it back out at you via standard output (stdout). We can redirect that output using the > character and send it to a file, rather than just to your screen. Try rerunning the command from the last step but now we will add an output redirect like so: echo hello world > eandujar.txt Step 11: Now use the file command again on the text file. Post a screenshot of the output here. Question 1.4: What changed about the output of the file command, why is it different? Step 12: Run the following command: head /etc/passwd to display the top 10 lines of this file. Post a screenshot of the output here. Question 1.5: Why are there no passwords contained in this file? What file actually stores passwords? Step 13: Now run the following: head -n 3 /etc/passwd and take a look at how the output differs from the last step. Question 1.6: What do the command, option, and the argument used in the previous step do? Explain each. Step 14: Research and find a command that can be used to only display the last 5 lines of a file. Use the command and post a screenshot of your output below. Question 1.7: Explain what the command you used in the previous step does and explain any options you used. Step 15: Use the cd (change directory) command to move around the file system. Enter the command cd / to change your directory from the student user’s home directory to the system’s root directory (which is represented by a “/”). Step 16: Use the command ls to see which directories are contained here, and then move into one of them using cd, then use pwd to show where you are. Post a screenshot after running these commands below. Note: You can move through more than 1 directory at a time if you know the whole path. Let’s try this in the next step. Step 17: From your current location, use the command cd /home/student Question 1.8: Is the file path used in the last step an example of a relative path or an absolute path? How do you know? Step 18: Use the pwd (print working directory) command to display what directory you are currently working in. Post a screenshot of your output below. Step 19: Use the touch command again to create a blank file named testfile1.txt in the student user’s home directory. Step 20: After creating the file, use ls again, but this time use the options -l (lowercase L) and -t to list out the files in this directory and post a screenshot to display that you have created a file named testfile1.txt in the /home/student directory. Question 1.9: What do the -l and -t options do? How did they change the output of the ls command? Step 21: Use the command mkdir (make directory) to create a new directory called Lab1 using the command mkdir Lab1. Since you are currently in /home/student, this new directory will be created there. Step 22: Use ls -lt again to view the newly created directory, and then use the file command on the Lab1 directory. Post a screenshot of the output of both commands below. Question 1.10: Without using the file command and without using the color-coded file names, how would you be able to tell that Lab1 is a directory based on the output of ls -lt? Step 23: Use the cp (copy) command to make a copy of testfile1.txt using the following command: cp testfile1.txt testfile2.txt After running this command use the ls -lt command again and paste a screenshot of your output. Question 1.11: Explain what the cp command in the last step is doing. Why doesn’t it remove the original file? Step 24: Now use the mv (move) command to move testfile2.txt to the Lab1 directory by entering the following command mv testfile2.txt Lab1/testfile3.txt Step 25: Use the ls -lt command twice to show the contents of your home directory and also the Lab1 directory and post a screenshot of the commands and output below. Step 26: Research what option you need with cp to copy the Lab1 directory and all of its contents into a new directory named LabOne. Post a screenshot of the command you used to achieve this, along with the output of ls -lt showing that it worked. Note: Use Google, or you can use man (manual) command to look at all the options for the copy command by using man cp. Step 27: Use the rm (remove) command to delete the file testfile1.txt with the command rm testfile1.txt. Then, use ls -lt and post a screenshot below of both commands. Step 28: Try to use the rmdir (remove directory) to remove the Lab1 directory with the command rmdir Lab1 it will not work. Question 1.12: Why can’t you use the rmdir (remove directory) command to delete the Lab1 directory in the previous step? Step 29: Use rm to delete the testfile3.txt file located in the Lab1 directory. Then try to use rmdir on Lab1 again. Post a screenshot showing that you were able to delete the Lab1 directory. Note: If your screen is getting too cluttered with commands, you can always use ctrl+l (lowercase L) to clear your screen. You can also type clear to clear the screen as well. Section 2: Users, Groups, and File Permissions Step 1: Try to use the useradd command to add a user (using the first initial of your first name, full last name, all lowercase, no spaces – i with the command useradd eandujar This will not be successful. Note: From here on out, when I refer to the yourname user, I am referring to this user account. Substitute it in commands accordingly with the correct username. Do not create a user named “yourname” or “knaughton”. If you do, your screenshots will not count. Step 2: Creating a user requires additional permissions. You will need to use the sudo command (super user do) before useradd in order to elevate your permissions for this command. Try again with the command sudo useradd eandujar. Step 3: You will be prompted for authentication to use the sudo command. Enter the CSEC378418! password that you configured for the student user