Changes

Jump to: navigation, search

Tutorial6: File Transfer / Sending Email Messages

123 bytes added, 09:03, 29 January 2020
INVESTIGATION 1: USING SECURE COPY
# 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: <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 a congratulations message, and proceed to the next step.<br><br>'''NOTE:''' As previously mentioned, we will simulate using the scp on another instance of our 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><br>
# Use a text editor to edit the following start-up file: '''~/.bashrc'''<br><br>
# Enter the following text (shown below) at the '''TOP''' of this startup file:<br><span style="color:#8B0000;font-family:courier;">[[ $- == *i* ]] || return </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>
# When prompted, enter your Matrix '''password'''.<br><br>
# Issue the same Linux command that you issued in '''step #1213'''.<br><br>What did you notice?<br><br>
# Issue the following Linux command: <br><span style="color:blue;font-weight:bold;font-family:courier;">scp myfile.txt yoursenecaid@matrix.senecacollege.ca:</span><br><br>Where do you think this file was copied to on your remote server?<br><br>
# Issue the '''ls''' command for the home directory.<br><br>What do you see?<br>What does this tell you about how the previously-issued command works with just a colon?<br><br>
# Issue the following Linux command (leaving-out the colon character at the end): <br><span style="color:blue;font-weight:bold;font-family:courier;">scp myfile.txt yoursenecaid@matrix.senecacollege.ca</span><br><br>What happened?<br><br>
# Make certain that your current directory is your '''home ''' directory.<br><br>
# Issue the following Linux command to run a checking script to ensure you created the CORRECT directories, created and copied the correct files: <br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/scripts/week6-check-2</span><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>
=INVESTIGATION 2: USING SECURE FILE TRANSMISSION CONTROL PROTOCOL =
13,420
edits

Navigation menu