How many ‘start’ scripts are associated with ‘runlevel 1’?

Practical 13

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Commands Used:

grep

sed

1) What is the regular expression to capture the date in mm/dd/yyyy format where mm is the month, dd is the day and yyyy is the year?

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

2) What are the limitations of this regex? (ie, can I enter a month over two digits? A 2-digit value over 12?)

3) Best practice as it relates to logging is to ‘aggregate’ or collect logs on a separate system as well as the host. If we are on the system that is aggregating those logs, and we want to pull all the messages that relate to our vm’s from the file named /opt/app/aggregate.log what would the regex be to find any event that has our hostname in it?

4) A common attack will be against DNS as it is a complex blend of host and networking skill sets, it’s not usually well understood how to set DNS up securely. How do we search the file above for any event from our vm’s that also contain the service name ‘named’ (without apostrophes, that was just to separate name and named)?

5) If neither of those show up, we would want to look at more general data. What would the command be to search the file above for an event from our host that had ‘error’ in the message section of an event?

6) What is the sed command to replace the first instance of ‘Sea’ in our teams.txt with the letter C?

7) Where does the output of the above command go to?

Commands Used

sed

awk

8) What happens if we run the sed command from question 6 and then redirect the STDOUT back to the same file with > ? (in essence, overwrite the file with the STDOUT of the regex after we saw it worked)

9) What happened to the content in teams.txt?

10) Why did this happen?

11) How could we work around this issue?

12) What is the sed command to replace every instance of Sea in teams2.txt with the letter C?

13) What is the awk command to print out every service that has caused a log message in our /var/log/messages file?

14) Redirect the output of an ls –alh into a file. Then vi the file, pick a single entry (for example, the location of the owner of the third file. It should either be student, or your user), and move the cursor to the start of the username. Replace the username with spaces so the owner of the file is blank, but all other data is lined up. For example:

-rw——- 1 student student 5.0K May 13 00:00 .bash_hisory

-rw——- 1 student 33 Mar 18 13:14 .bash_logout

That is the third column of data (if you use another column, you will have to reference your column accordingly). What is the awk command to show the list of each value in the third column of our redirected file?

15) What is the awk command to show each value in the fourth column of our file (or adjust your value if you did not modify the third column – what is the value of the next column over)?

16) What happened to that value?

17) Why?

Practical 14

Commands Used:

grep

1) What would the regular expression be to search through the /var/log/messages files for an IP address?

2) In the student user’s home directory, what does the following command return?

grep ‘in’ teams.txt

3) In the student user’s home directory, what does the following command return?

grep ‘i[nc]’ teams.txt

4) From our regex cheatsheet, break down the Date regex from the Sample Patterns box at the bottom.

(\d{1,2}\/\d{1,2}\/\d{4})

How many symbol groups (combinations of symbols, numbers and letters that have a specific meaning in a regex – for instance \s for any spaces is one symbol group) are there in this regex, and what are they?

5) What does the first symbol group do?

6) What does the final symbol group do?

7) What is a limitation of this regex?

Commands Used:

grep

8) What is a regex to capture the date in year-month-day format?

9) What is the command to search our teams.txt file to show any line with either Bears or Seahawks?

10) What would the regular expression be to use with grep to search the /var/log/messages file and search for either apache or http?

Practical 15

User

Password

student Pug3t$ound!

root m7.r@!N!er

Commands Used:

ls

startx

1) Run an ls of the /etc/rc0.d folder. How many ‘start’ scripts are in this directory?

2) Why? (ie, what do those ‘start’ scripts do?)

3) How many ‘start’ scripts are associated with ‘runlevel 1’?

4) How many start scripts are in the /etc/rc2.d folder (ie, in ‘runlevel 2’)?

5) Why are K###### or ‘kill’ scripts located in the /etc/rc[0-6].d folders?

6) What graphical user interface is started by default in CentOS5/RHEL5?

7) What runlevel does our vm (the one we use in class) start in?

8) What is one text editor we are able to use in the shell?

9) What is one text editor in the GUI?

10) Is the text editor from #3 available in the GUI?

11) How do you open a shell/command prompt in the GUI?

12) How does this shell/command prompt differ from the one we use when we do not boot into the GUI?

13) Windows uses Remote Desktop Protocol – or RDP – to connect via GUI to other systems. With that in mind, what does the utility at ‘System->Preferences->Remote Desktop’ do?

14) Will the utility in question 8 connect to Windows servers?

Practical 16


User

Password

student Pug3t$ound!

root m7.r@!N!er


Commands Used:

ls

1. Draw the Linux file structure including root, etc, home, and var, with etc having the profile file and httpd directory, home having your user and the student user’s home directories, and var having the log directory. Inside the /etc/httpd directory should be the conf directory, which contains the httpd.conf file. Inside both the student and your user’s home directories should be the .bash_profile file (/home/student/.bash_profile and /home//.bash_profile). Inside the /var/log directory should be the messages file.

I can do this one

2. What is the absolute path of the student user’s .bash_profile from question 1?

3. If we are in the /home/student folder, what is the relative path of the student user’s .bash_profile file from question 1?

4. If we are in /home/, what is the relative path of the student user’s .bash_profile file from question 1?

5. What is the command to ‘list’ ‘show’ or ‘print to standard output’ all the files in the student user’s home directory?

6. What is the command to print the list of currently running processes and check to see if the Apache web server (whose service name in CentOS/RHEL is httpd) is running?

7. We are attempting to disable a user. We have opened the /etc/shadow file in vi and put an x into the password field, which will not allow the user to log into the system. When we move into command mode and press :wq the system errors that the file is read-only. What do we need to do to apply the desired change to our /etc/shadow file?

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER