Changes

Jump to: navigation, search

Tutorial6: File Transfer / Sending Email Messages

766 bytes added, 10:11, 10 February 2021
INVESTIGATION 3: FILE TRANSFER (EMAIL)
# On your local computer, open the <span style="color:blue;font-family:courier;font-weight:bold;">NotePad</span> application to create a text file.<br><br>
# Enter a few lines of text, and then click on the <b>File</b> menu and select <b>save as</b><br>(save as the filename <span style="color:blue;font-weight:bold;font-family:courier;">yourfile.txt</span> in your <span style="color:blue;font-weight:bold;font-family:courier;">local</span> directory)<br>and then <b>exit</b> the <i>Notepad</i> text editor.<br><br><table align="right"><tr valign="top"><td>[[Image:graphical-sftp-icon.png|thumb|right|110px|Double Click on SFTP to launch graphical application.]]</td><td>[[Image:sftp-connect.png|thumb|right|200px|Using Quick Connect to login to your Matrix Linux server.]]</td></table>
# In your local computer's command terminal, make certain that you are in the '''local''' directory, and if not, change to that directory and confirm that you have changed to that directory.<br><br># Issue the <span style="color:blue;font-weight:bold;font-family:courier;">dir</span> command for the '''local''' directory to confirm your properly copied that you created the file from Matrixcalled '''yourfile.txt'''<br><br># On your Windows desktop, point and '''double-click ''' on the<br>'''SSH Secure file Transfer''' application icon.<br><br># The main Secure Shell SFTP application window should appear.<br><br>'''FYI:''' This application shows files on your home computer (on the left-side) and files on your remote Matrix computer on the right-side. You will NOT see files <br>for your Matrix server since you<br>have NOT logged into the Matrix server.<br><br>
# Click the '''Quick Connect''' button located in the Secure SFTP application window.<br><br>'''NOTE:''' The Connect dialog box allows the user to specify the '''server name'''<br>and your '''account name''' to allow you to connect to the server.<br><br>
# Click on the textbox labelled '''Hostname''' and type the text: <span style="color:blue;font-weight:bold">matrix.senecacollege.ca</span><br><br>
# After entering the ''hostname'' and ''username'', click the '''Connect''' button.<br><br>
# Enter your Seneca password when prompted.<br><br>
# When you correctly connect to your Matrix account, you should see '''folders '''<br>in your remote server<br>(i.e. Matrix server).<br><br>[[Image:graphical-sftp-application.png|thumb|right|250px|'''Click''' and '''drag''' file(s) to transfer between computers.]]
# There are two sub-windows to represent your local computer on the <u>left</u><br>and the remote (Matrix) server on the <u>right</u>.<br><br>
# In the <u>left</u> (local computer) window, navigate to point and '''double-click''' on your Windows<br>profile name (i.e. ''username'') and then locate and '''double-click''' on the '''local''' directory.<br><br># In the <u>right</u> (remote Matrix server) window, navigate to the '''remote2''' directory<br>and '''double-click''' to move to that directory.<br><br>
# In the left window, click and drag the '''yourfile.txt''' file to the <u>right</u> window.<br><br>
# Confirm Check to see that the '''yourfile.txt''' file appears in the <u>right</u> window to confirm <br>that the file was has been transferredto your Matrix server.<br><br>'''NOTE:''' You can select multiple files by using ''SHIFT-CLICK'' or ''CTRL-CLICK'' methods<br>and then click and drag file selections between computers.<br><br># Take a few moments to see noter other buttons for both local and remote windows to <br>'''refresh the view''', '''delete file(s)''', '''navigate up to parent directory''', etc.<br><br># Click the '''File''' menu, and select '''Disconnect''' and then click '''OK''' to disconnect your sftp connection.<br><br># Now that you have disconnected, '''close''' the sftp application window.<br><br># Return to your command terminal on your <u>local</u> computer(do '''NOT''' connect to Matrix!).<br><br>
# Issue the following Linux command to run a checking script to confirm that you transferred<br>the most recently-created textfile to the '''remote2''' directory in Matrix:<br><span style="color:blue;font-weight:bold;font-family:courier;">ssh yoursenecaid@matrix.senecacollege.ca bash /home/murray.saul/scripts/week6-check-4</span><br><br>
# When prompted, enter your password.<br><br>
# If you encounter errors, make corrections and then re-run the checking script until you receive a congratulations message.<br><br>
Your The '''Matrix''' server is also an '''email server''' that can allow you to '''send''' and '''receive''' text-based emails messages to other email messagesaccounts.
In this section, you will learn how to '''transfer''' a file from your Matrix server to another computer systemby sending<br>by sending an '''email message ''' with a '''file attachment'''.
# When prompted, enter the '''subject line''': <span style="color:blue;font-weight:bold;font-family:courier;">Test Message</span><br>and press <span style="color:blue;font-weight:bold;font-family:courier;">ENTER</SPAN><br><br>
# In the email message '''BODY''' section, type the following text displayed below (and press '''ENTER'''):<br><span style="font-weight:bold;font-family:courier;">This is a test email message</span><br><br>
# Press <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-d</span> to send your email message.<br><br>Did any output display after you sent this email message? If so, what What you do think '''EOT''' stands for?<br><br># Launch a '''web-browser''', login into your '''Seneca email''' account and check for new email messages.<br>Did you receive the email message that you sent from your Matrix server?<br><br>If you did NOT receive an e-mail message, check the '''JUNK''' or '''CLUTTER''' folders.<br>If you still did not receive an email message, return to your terminal and re-issue the '''mail''' command<br>making certain that you pressed <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-d</span> instead of pressing '''ctrl-c'''<br><br># Return to your terminal (i.e. Linux Bash shell ) and issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">mail -a ~/remote/myfile.txt yoursenecaid@myseneca.ca</span><br><br>
# When prompted, enter the subject line: <span style="color:blue;font-weight:bold;font-family:courier;">Test Message with Attachment</span><br> and press <span style="color:blue;font-weight:bold;font-family:courier;">ENTER</span><br><br>
# In the email message '''BODY''' section, type the following text displayed below (and press '''ENTER'''):<br><span style="font-weight:bold;font-family:courier;">This is a test email message with a file attachment</span><br><br>
# Press <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-d</span> to send your message.<br><br>
# Switch to your Seneca email and check your Seneca for new email for messages. Did you receive that email message?<br><br># Check your email to see if Did you received your receive that email message. If you did, what do you notice? Does the email contain a file attachment?<br><br># Return to your Linux Bash shell and issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">mail yoursenecaid@myseneca.ca &lt; ~/remote/myfile.txt</span><br><br>What happened? Were you prompted for subject and could you enter text in email body?<br>Did you see a file attachment as a separate file, or just text?<br><br># Check your email to see if you received your email message. If you did, what do you notice regarding the subject line?<br><br>You should have noticed that there was '''NO''' customized '''subject line''',<br>since you redirected '''standard input''' (''stdin'') from the file, thus so there was no way <br>for the user to send a subject line.<br><br>You can use the '''-s''' option, followed by text (in quotes) to specify a '''subject line'''.<br><br># Return to your Linux Bash shell and issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">mail -s "email with attachment" yoursenecaid@myseneca.ca &lt; ~/remote/myfile.txt</span><br><br>
# Check your email to see if you received your email message. If you did, what do you notice this time?<br><br>
# After completing this INVESTIGATION, perform the LINUX PRACTICE QUESTIONS at the end of the tutorial.<br><br>
13,420
edits

Navigation menu