13,420
edits
Changes
→INVESTIGATION 1: USING SECURE COPY
'''Perform the Following Steps:'''
<span style="color:blue;">NOTE: You will need to open a terminal in yours OS (instead of running a graphical SSH application) for this tutorial. You can refer to the following link on how to perform that operation.</span><br><br>
# '''Login''' to your matrix account and issue a command to '''confirm''' you are located in your '''home''' directory.<br><br>
# Issue the following Linux commands to create the following directories:<br><span style="color:blue;font-weight:bold;font-family:courier;">mkdir ~/from<br>mkdir ~/destination</span><br><br>
# Change back to your '''home''' directory and confirm that you are located in your ''home'' directory.<br><br>Let's run a '''shell script''' to check that you created the correct directories<br>and that you created the '''myfile.txt''' file (with correct file contents) in the '''~/from''' directory<br>before using the ''scp'' Linux command.<br><br>
# Issue the following Linux command to run that checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/scripts/week6-check-1</span><br><br>
# If you encounter errors, make corrections and then re-run the checking script until you receive<br>a congratulations message, and proceed to the next step.<br><br><span style="color:blue;">'''ATTENTIONNOTE:''' Since the only server account you have is your '''Matrix''' server,<br>we We will simulate using the scp command now learn to copy from transfer files between your '''Matrix''' server to<br>'''<u>another instance</u> of home computer and your remote Matrix Linux server'''.<br><br>To make this work, we will need to edit a "start-up" file to place a special series of commands.<br>You will learn more about start-up files later in this course.</span><br><br># Use a text editor to edit the following start-up file: '''<span style="font-family:courier">~/.bashrc</span>'''<br><br># '''Copy''' and '''paste''' the following text (shown below) at the '''TOP''' of your startup file:<br><span style="font-family:courier;font-weight:bold;">[[ $- == *i* ]] || return </span><br><br># '''Save''' editing changes to this startup file and exit your text editor.<br><br>
# Issue the following Linux command to confirm that the '''~/destination''' directory is empty:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls ~/destination</span><br><br>
# Issue the following Linux command to copy the myfile.txt from your local server to your remote server (i.e. yoursenecaid is YOUR Seneca ID):<br><span style="color:blue;font-weight:bold;font-family:courier;">scp myfile.txt yoursenecaid@matrix.senecacollege.ca:destination</span><br><br>'''NOTE:''' You may be required to enter '''yes''' to have the public key shared.<br><br>
# If you encounter errors, make corrections and then re-run the checking script until you receive a congratulations message.<br><br>
:In the next investigation, you will use the '''sftp''' Linux command to transfer (i.e. copy) files between servers.<br><br>
<!-- RESIDUAL FROM LESS EFFECTIVE METHOD OF COPYING FILES BETWEEN SERVERS
<span style="color:blue;">'''ATTENTION:''' Since the only server account you have is your '''Matrix''' server,<br>we will simulate using the scp command to copy from your '''Matrix''' server to<br>'''<u>another instance</u> of your Matrix server'''.<br><br>To make this work, we will need to edit a "start-up" file to place a special series of commands.<br>You will learn more about start-up files later in this course.</span><br><br>
# Use a text editor to edit the following start-up file: '''<span style="font-family:courier">~/.bashrc</span>'''<br><br>
# '''Copy''' and '''paste''' the following text (shown below) at the '''TOP''' of your startup file:<br><span style="font-family:courier;font-weight:bold;">[[ $- == *i* ]] || return </span><br><br>
# '''Save''' editing changes to this startup file and exit your text editor.<br><br> -->
=INVESTIGATION 2: USING SECURE FTP =