Changes

Jump to: navigation, search

OPS705 Lab 2

1,522 bytes added, 15:36, 19 January 2023
Switching to SSH keypair authentication:
=== SSH Listen Port ===
[[Image:Ops705_sshd_listenport_custom.png|right|400px|thumb|Figure 10: Setting the custom listen port for SSHd.]]
# From the command line, run the following (it will take a few minutes): <code>sudo semanage port -a -t ssh_port_t -p tcp 22222</code>
# Using vim, open the SSH configuration file: <code>sudo vim /etc/ssh/sshd_config</code>
# Find the line (near the top) containing the words: '''Port 22'''
# With a second terminal, verify that you can login to your VM's SSH from your personal computer without a password (keypair authentication). Do not move on to the next step until you’re sure.
#* Login the same way as before. '''If you aren't asked for a password, then keypair authentication has succeeded.'''
# Save both keys (''id_rsa'' and ''id_rsa.pub'') to secondary, portable location. This can be online storage like OneDrive or Dropbox, or to a USB drive. You will need your keys when you come to class to log in to your Linux VM going forward.
=== Adding Your Professor's Public Key ===
#* If you can't reconnect, use your control terminal window to find any mistakes you may have made. Remember, don't disconnect from your control terminal until you're sure you can reconnect! Use as many test terminal windows as you need.
= INVESTIGATION 4: Confirming Your Linux Work =[[Image:script-check-lab2.png|thumb|right|400px|If all checks pass, then user performed task correctly and can continue.]]===Running a Shell Script to Check Your Work=== Although you have been double-checking your work (right?), you ''might'' have made some mistakes. For example:* Forgetting to enable iptables.* Missing a firewall rule.* Forgetting to update Linux. To check for mistakes, a '''shell script''' has been created to check your work. '''If the checking shell script detects an error''', then it will tell you and offer constructive feedback on how to fix that problem so you can re-run the checking shell scripts until your work is correct. Perform the following steps:# Change directories to ~/bin: <code>cd ~/bin</code># Make sure you have the most recent lab files: <code>git pull</code># Change back to your home directory: <code>cd ~</code># Run the checking script for your Linux work in this lab: <code>labcheck2.sh</code>#* If you encounter errors, then view the feedback to make corrections, and then re-run the checking script.#* If all checks pass, then proceed to the next part.# Assuming you passed all checks, take a screenshot of the full script output. You'll need it for later. = INVESTIGATION 5: Updating Windows Server 2019 =
Updating your Windows Server VM in Azure is a little bit easier. It takes advantage of the cloud infrastructure to allow point-and-click updates.

Navigation menu