Changes

Jump to: navigation, search

OPS235 Lab 4

No change in size, 20:20, 28 December 2019
URL change for lab files.
#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="cursor:default;color:#3366CC;font-size:1.2em;">wget https://ict.senecacollege.ca/~ops235/lab4labs/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 https://ict.senecacollege.ca/~ops235/lab4labs/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 https://ict.senecacollege.ca/~ops235/lab4labs/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.

Navigation menu