Changes

Jump to: navigation, search

OPS235 Lab 4

7 bytes removed, 14:55, 22 December 2018
LAB 4 SIGN-OFF (SHOW INSTRUCTOR)
# What did you notice?
# Issue the following Linux command: <b><code><span style="color:#3366CC;font-size:1.2em;">startx</span></code></b><br>What happens? Why would you want to make a graphical Linux system run in text-based mode?
# Log-off your graphical system. You should return to your CLI shell prompt and change to root user. You should notice at this point that the command '''xstartstartx''' did not reset your run-level.
# Reissue the '''init''' command to change the current run-level back to '''5'''<br>Did it work?
# Issue the runlevel command to verify that the run-level is set to '''5''' (i.e. Graphical). You should notice a '''3 followed by a 5'''. That is to indicate that the '''current''' run-level is 5, but <u>previously</u>, it was set to 3.
#Open a shell terminal, and login as root.
#Change to the '''/root/bin''' directory.
#Download, study, and run the following shell script. Issue the command:<br><b><code><span style=" pointer-events:none;cursor:default;color:#3366CC;font-size:1.2em;">wget httpshttp://scscs.senecac.onsenecacollege.ca/~murray.saulops235/lab4/user-create.bash</span></code></b>
#Try to understand what these Bash Shell scripts do, and then run the script as root to create just one user called '''test'''. After running the shell script, view the contents of the '''/home''' directory to confirm.
<ol><li value="6">Open a Bash shell terminal and login as root.</li><li>Change to the '''/root/bin''' directory.</li><li>Use the wget command to download the input file called user-data.txt by issuing the command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">wget httpshttp://scscs.senecac.onsenecacollege.ca/~murray.saulops235/lab4/user-data.txt</span></code></b></li><li>View the contents on the user-data.txt file to confirm there are 3 fields (username, fullname, and e-mail address)which are separated by the colon (:) symbol.</li><li>Use a text editor (such as <b><code><span style="color:#3366CC;font-size:1.2em;">vi</span></code></b> or <b><code><span style="color:#3366CC;font-size:1.2em;">nano</span></code></b>) to create a Bash Shell script called: <b><code><span style="color:#3366CC;font-size:1.2em;">createUsers.bash</span></code></b> in the /root/bin directory.</li><li>Enter the following text content into your text-editing session:</li></ol>
<code style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;font-weight:bold;">
<br>
# Switch to your '''c7host''' VM.
# Open a shell terminal, '''su -''' into root, and change to the '''/root/bin''' directory.
# Issue the Linux command: <b><code><span style="color:#3366CC;font-size:1.2em;">wget http://matrixcs.senecac.onsenecacollege.ca/~murray.saulops235/ops235lab4/lab4-check.bash</span></code></b>
# Give the '''lab4-check.bash''' file execute permissions (for the file owner).
# Run the shell script and if any warnings, make fixes and re-run shell script until you receive "congratulations" message.
#Arrange proof of the following on the screen:<br><span style="color:green;font-size:1.5em;">&#x2713;</span> '''centos1''' VM:<blockquote><ul><li>Demonstrate that this VM 's current run-level is set to '''5'''.</ul></blockquote><span style="color:green;font-size:1.5em;">&#x2713;</span>'''c7host''' machine<blockquote><ul><li>Run the '''lab4-check.bash''' script in front of your instructor (must have all <b><code><span style="color:#66cc00;border:thin solid black;font-size:1.2em;">&nbsp;OK&nbsp;</span></code></b> messages)</li></ul></blockquote><span style="color:green;font-size:1.5em;">&#x2713;</span> '''Lab4''' log-book filled out.
 
= Practice For Quizzes, Tests, Midterm &amp; Final Exam =

Navigation menu