1,234
edits
Changes
no edit summary
{{Admon/caution|DO NOT USE THIS VERSION OF THE LAB. This page will no longer be updated.|'''New version here:''' https://seneca-ictoer.github.io/ULI101/A-Tutorials/tutorial6<br />'''Andrew's students please go here:''' http://wiki.littlesvr.ca/wiki/OPS145_Lab_6}}=TRANSFERRING FILES / USING THE MAIL COMMANDBETWEEN COMPUTERS=
<br>
===Main Objectives of this Practice Tutorial===
:* List '''common utilities''' combined with contained in the '''ssh''' suite of utilitiesapplication framework
:* Securely '''copy ''' files between Unix/Linux servers using the '''scp''' command
:* Securely '''transfer ''' copies of files between Unix/Linux servers using the '''sftp''' command
:* Use the mail '''ssh''' command to send email messages to your Seneca email accountrun and view commands on a '''remote computer''' from a '''local computer'''.
:* Use the '''mail ''' command to send email with '''file attachments ''' to your Seneca email account
<br>
|- valign="top" style="padding-left:15px;"
|colspan="2" |Course Notes'''Slides:'''<ul><li>Week 6 Lecture 1 Notes:<br>[https://ictwiki.cdot.senecacollege.ca/~murray.saululi101/uli101slides/ULI101-Week66.1.pdf PDF] | [https://ictwiki.cdot.senecacollege.ca/~murray.saululi101/uli101slides/ULI101-Week66.1.pptx PPTX]</li></ul>
| style="padding-left:15px;" |'''Definitions:'''
* [https://en.wikipedia.org/wiki/Secure_copy Secure Copy]
* [https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol Secure File Transfer Protocol]
* [https://en.wikipedia.org/wiki/Mail_(Unix) Email]<br><br>
| style="padding-left:15px;"|'''File Transfer Commands:'''
* [http://man7.org/linux/man-pages/man1/scp.1.html scp]
* [http://man7.org/linux/man-pages/man1/sftp.1.html sftp]
* [https://man.openbsd.org/mail mail]
|colspan="1" style="padding-left:15px;" width="30%"|'''Instructional Videos:'''<ul><li>[https://www.youtube.com/watch?v=EBvxbuhDKBw Using scp Command]</li><li>[https://www.youtube.com/watch?v=QcKYFEgfV-I Using sftp Command]</li><li>[https://www.youtube.com/watch?v=Iuf_mLrvh2o Using the mail Command]</li></ul>
|}
= KEY CONCEPTS =
The '''ssh''' Linux command is actually a '''suite of tools''' to allow the user to not only issue Linux commands securely between <br>Unix / Linux servers, but also as well as securely copy and transfer files among Unix/Linux servers via the commands '''scpcopy''' and '''sftptransfer'''files among Unix/Linux servers.
In this tutorial, you will learn several different methods to securely transfer files from your Matrix Linux account <br>to other computers<br>using Linux commands including '''scp''', '''sftp''' and '''mail'''.
===Issuing Commands on Remote Unix/Linux Servers===[[Image:scpssh-diagramremote.png|thumb|right|450px350px|The '''scpssh''' Unix/Linux command is can be used to securely copy files between Unix<u>run</u> and <u>view</Linux serversu> commands on '''remote computer''' from a '''local computer'''.]]You can use the '''ssh'''Secure copy protocol (command to issue Unix/Linux commands on a '''scpremote''') is a means of securely transferring server<br>from your <u>local</u> computer files between a local host and without logging into a remote host or between two remote hosts. It is based on the Secure Shell server (SSHsuch as Matrix) protocol. "SCP" commonly refers to both the Secure Copy Protocol and the program itself.''
''Command Usage:''
You will be prompted for your Matrix account password, then the contents of your home directory in your remote Matrix account will be displayed on your <u>local</u> computer'''scp locals terminal.file user@host:destination-pathname''' <br><br>
[[Image:scp-diagram.png|thumb|right|350px|The '''scp''' Unix/Linux command is used to securely copy files between Unix/Linux servers.]]The '''scp ''' command is used to <u>securely</u> copy files between your '''local''' computer and '''remote''' Unix/Linux server.file The usage for the ''scp'' command is similar to the '''cp''' command with the addition of '''user name''' and '''host:name'''.
The most common '''mistake''' that students make is forgetting to add<br>the '''colon''' character ":" <u>after</u> the remote hostname. The user name in the command can be '''omitted''' if it's the same as on the <u>local</u> host.<br>Multiple file and recursive directory copy (i.e. option '''-Rr''') is supported.
<br><br>
[[Image:sftp-diagram.png|thumb|right|350px|The '''sftp''' Unix/Linux command is used to securely transfer (copy) files between Unix/Linux servers.]]
'''FTP<span style="font-family:courier">sftp username@hostname</span>''' is an acronym for '''File Transfer Protocol''' which provides a framework of rules on how to convert data that is transferred between computer servers (both identical and different).
When you login via the ''sftp '' command, you are in the '''sftp prompt''' (appears. The sftp prompt is like a Bash shell prompt, but with a limited number of commands).When issuing sftp commands it is important to understand that , the local server relates to the server where you first issues issued the sftp command.Refer to the diagram on the right for <u>local</u> and <u>remote</u> ''sftp'' commands.[[Image:graphical-sftp-application.png|thumb|right|250px|'''Graphical''' SFTP application.]]
'''<big>Graphical SFTP Applications</big>'''
===Sending Emails with File Attachment (mail)===
=== Command Line Terminal (CLI) ===
Let's look at using the '''sftp''' command on your '''local''' machine.
'''Perform the Following Steps:'''
[[Image:cmd.png|thumb|right|275px|Make certain to <u>remain</u> in the<br>command-line terminal in your '''local''' computer.]]
# Make certain that you are in a command terminal on your <u>local</u> computer<br>(i.e. do '''NOT''' log into your Matrix account).<br><br>
# Issue a command (depending on your OS) to confirm that you are located in the '''local''' directory in your home computer.<br><br>
# If you are in MS Windows, open the <span style="color:blue;font-family:courier;font-weight:bold;">NotePad</span> application to create a text file<br>(otherwise: use another text editor like <b>vi</b> or <b>nano)</b><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;">thefile.txt</span> in your <span style="color:blue;font-weight:bold;font-family:courier;">local</span> directory) and then <b>exit</b> the <i>Notepad</i> text editor.<br><br>If you using another OS, then save-as using the same filename and directory location for the text editor you are using.<br><br>
# If your OS is MS Windows issue the <span style="color:blue;font-family:courier;font-weight:bold;">dir</span> Windows command to view the contents of your current directory<br>(otherwise, issue the <b>ls</b> command for other operating systems).<br><br>'''Note:''' the <u>relative</u> pathname symbols "'''.'''" and "'''..'''" work for the ''Windows''/''MacOSx''/''Unix''/''Linux'' operating systems.<br><br>
# Issue the following command to move to the '''parent''' directory: <span style="color:blue;font-family:courier;font-weight:bold;">cd ..</span><br><br>
# If your OS is MS Windows issue the <span style="color:blue;font-family:courier;font-weight:bold;">dir</span> Windows command to view the contents of that parent directory that you changed to<br>(otherwise, issue the <b>ls</b> command for other operating systems).<br><br>
# Issue the following command to start an '''sftp''' session (note: yoursenecaid is YOUR Seneca ID):<br><span style="color:blue;font-weight:bold;font-family:courier;">sftp yoursenecaid@matrix.senecacollege.ca</span><br><br>'''NOTE:''' You may be required to enter '''yes''' to have the public key shared.<br><br>[[Image:sftp-commands.png|thumb|right|350px|Common '''sftp''' commands to manage the transfer<br>of files between computers.]]
# You should be in the '''sftp command prompt''' where you are expected to issue '''sftp commands'''. Please take a moment to view common<br><u>local</u> and <u>remote</u> ''sftp commands'' on the right-side table.<br><br>
# Issue the following ''sftp command'': <span style="color:blue;font-weight:bold;font-family:courier;">pwd</span><br><br>What is the pathname? Which server does this represent: local or remote?<br><br>
# Issue the following ''sftp command'': <span style="color:blue;font-weight:bold;font-family:courier;">lpwd</span><br><br>What is the pathname? Which server does this represent: local or remote?<br><br>
# Issue the following ''sftp command'' to create a directory on your remote server: <span style="color:blue;font-weight:bold;font-family:courier;">mkdir remote2</span><br><br>
# Issue the following ''sftp command'' to confirm that the '''remote2''' directory has been created<br>in your remote server's home directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls</span><br><br>
# Issue the following ''sftp command'' to change to the '''remote2''' directory on your ''remote'' server:<br><span style="color:blue;font-weight:bold;font-family:courier;">cd remote2</span><br><br>
# Issue the '''pwd''' ''sftp command'' to confirm that you have changed to the ''remote2'' directory on your remote server.<br><br>
# Issue the following sftp command to change to the '''local''' directory on your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">lcd local</span><br><br>
# Issue the '''lpwd''' ''sftp command'' to confirm that you have changed to the ''local'' directory on your local computer.<br><br>
# Issue the following ''sftp command'' to transfer the file called '''thefile.txt''' to the '''~/remote2''' directory on your remote server:<br><span style="color:blue;font-weight:bold;font-family:courier;">put thefile.txt</span><br><br>
# Issue the '''ls''' sftp command to confirmed that you transferred the file called: '''thefile.txt'''<br><br>Let's create another directory on your local computer called '''local2''' so we can learn to <u>download</u> a file from your remote directory.<br><br>
# Issue the following ''sftp command'' to change to the '''parent''' directory on your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">lcd ..</span><br><br>
# Issue the '''lpwd''' ''sftp command'' to confirm that your current working directory on your local computer is your home directory.<br><Br>
# Issue the following ''sftp command'' to create the following directory on your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">lmkdir local2</span><br><br>
# Issue the following ''sftp command'' to change to the '''local2''' directory on your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">lcd local2</span><br><br>
# Issue the '''lpwd''' ''sftp command'' to confirm you have changed to the '''local2''' directory on your local computer.<br><br>Let's learn to <u>download</u> a file from your remote server to your local computer.<br><br>
# Issue the following '''sftp command''' to transfer your '''thefile.txt''' file from the '''remote2''' directory<br>on your remote server to your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">get thefile.txt</span><br><br>
# Issue the <span style="font-weight:bold;font-family:courier;">lls</span> ''sftp command'' to confirm that you transferred the file '''thefile.txt''' to your local computer.<br><br>
# Issue the following ''sftp command'' to exit the sftp utlilty: <span style="color:blue;font-weight:bold;font-family:courier;">exit</span><br><br>
# Issue the following Linux command to remotely run a checking script to ensure you created the correct directories<br>and properly transferred those created files: <br><span style="color:blue;font-weight:bold;font-family:courier;">ssh yoursenecaid@matrix.senecacollege.ca ~uli101/week6-check-3</span><br><br>
# If you encounter errors, make corrections and then re-run the checking script until you receive a congratulations message.<br><br>'''FYI:''' To run a checking program to check if you created the '''local''' and '''local2''' directories in MS Windows would require<br>running a local-based script (like '''PowerShell'''). Since this is a Unix/Linux based course, we don't have a PowerShell script,<br>so we will ignore checking for files transferred to your local computer.
<!-- OLDER CONTENT
# Make certain that you are logged into your Matrix account and 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 ~/local</span><br><br>
# Change to the '''~/local''' directory.<br><br>
# Use a text editor to create a text file called '''thefile.txt'''<br><br>
# Enter the following two lines displayed below for this text file:<br><span style="font-family:courier;font-weight:bold;">This is my file called thefile.txt<br>It is also a small file</span><br><br>
# '''Save''' editing changes to the text file and exit your text editor.<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 to make certain that you created the correct directories<br>and that you created the '''myfile.txt''' file (with correct file contents) in the '''~/local''' directory<br>before learning to use the ''sftp'' Linux command.<br><br>
# Issue the following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">~uli101/week6-check-3</span><br><br>
# Issue the following Linux command to start an sftp session (note: yoursenecaid is YOUR Seneca ID):<br><span style="color:blue;font-weight:bold;font-family:courier;">sftp yoursenecaid@matrix.senecacollege.ca</span><br><br>'''NOTE:''' You may be required to enter '''yes''' to have the public key shared.<br><br>You are now in the '''sftp command prompt''' where you are expected to issue '''sftp commands'''.<br>Please refer to the table of ''sftp commands'' in the '''KEY CONCEPTS''' section for reference.<br><br>
# Issue the following ''sftp command'': <span style="color:blue;font-weight:bold;font-family:courier;">pwd</span><br><br>What is the pathname? Which server does this represent: local or remote?<br><br>
# Issue the following ''sftp command'': <span style="color:blue;font-weight:bold;font-family:courier;">lpwd</span><br><br>What is the pathname? Which server does this represent: local or remote?<br><br>
# Issue the following ''sftp command'' to create a directory on your remote server: <span style="color:blue;font-weight:bold;font-family:courier;">mkdir remote</span><br><br>
# Issue the following ''sftp command'' to confirm that the '''remote''' directory has been created in your remote server's home directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls</span><br><br>
# Issue the following ''sftp command'' to change to the '''remote''' directory on your ''remote'' server:<br><span style="color:blue;font-weight:bold;font-family:courier;">cd remote</span><br><br>
# Issue the '''pwd''' ''sftp command'' to confirm that you have changed to the ''remote2'' directory on your remote server.<br><br>
# Issue the following sftp command to change to the '''local''' directory on your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">lcd local</span><br><br>
# Issue the '''pwd''' ''sftp command'' to confirm that you have changed to the ''local'' directory on your local computer.<br><br>
# Issue the following ''sftp command'' to transfer your '''~/local/thefile.txt''' file to the '''~/remote''' directory on your remote server:<br><span style="color:blue;font-weight:bold;font-family:courier;">put thefile.txt</span><br><br>
# Issue the '''ls''' sftp command to confirmed that you transferred/copied the file: '''thefile.txt'''<br><br>Let's create another directory on your local computer called '''local2''' so we can learn to <u>download</u> a file from your remote directory.<br><br>
# Issue the following ''sftp command'' (without an argument) to change to your '''home''' directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">lcd ~</span><br><br>
# Issue the '''lpwd''' ''sftp command'' to confirm that your current working directory on your local computer is your home directory.<br><Br>
# Issue the following ''sftp command'' to create the following directory on your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">lmkdir local2</span><br><br>
# Issue the following ''sftp command'' to change to the '''local2''' directory on your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">lcd local2</span><br><br>
# Issue the '''lpwd''' ''sftp command'' to confirm you have changed to the ''local2'' directory on your local computer.<br><br>Let's learn to <u>download</u> a file from your remote server to your local computer.<br><br>
# Issue the following '''sftp command''' to transfer your '''thefile.txt''' file from your remote directory on your local computer:<br><span style="color:blue;font-weight:bold;font-family:courier;">get thefile.txt</span><br><br>
# Issue the '''lls''' '''sftp command''' to confirm that you transferred/copied the file: thefile.txt on your local computer.<br><br>
# Issue the following ''sftp command'' to exit the sftp utlilty: <span style="color:blue;font-weight:bold;font-family:courier;">exit</span><br><br>
# Issue the '''ssh''' command to login to your Matrix server account.<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;">ssh yoursenecaid@matrix.senecacollege.ca ~uli101/week6-check-3</span><br><br>
# If you encounter errors, make corrections and then re-run the checking script until you receive a congratulations message.<br><br>
Let's run the '''Secure Shell SFTP application''' to transfer files between computers.<br>This investigation assumes that your computer is a '''Windows''' machine. If you local computer<br>is '''NOT''' a ''Windows'' machine, you can <u>skip</u> this investigation.
'''Perform the Following Steps:'''
# xOn 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.<br><br># Issue the <span style="color:blue;font-weight:bold;font-family:courier;">dir</span> command for the '''local''' directory to confirm that you created the file called '''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 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># Click on the textbox labelled '''User Name''' and type your Seneca username<br>(i.e. same as your Seneca userid).<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 (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, 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># Check to see that the '''yourfile.txt''' file appears in the <u>right</u> window to confirm<br>that the file has been transferred to 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 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 ~uli101/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>
The '''Matrix''' server is also an '''email server''' that can allow you to '''send''' emails messages to other email accounts.
In this investigation, you will learn how to '''transfer''' a file from your Matrix server to another computer by sending<br>an '''email message''' with a '''file attachment'''.
'''Perform the Following Steps:'''
# xMake certain that you connect and login to your '''Matrix''' server and confirm that you are located in your '''home''' directory.<br><br># Issue the following Linux command (using your Seneca-ID):<br><span style="color:blue;font-weight:bold;font-family:courier;">mail yoursenecaid@myseneca.ca</span><br><br># 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? 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 for new email messages.<br><br>Did you receive that email message? 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 < ~/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, 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 < ~/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>
= LINUX PRACTICE QUESTIONS =
simulate a quiz:
https://ictwiki.cdot.senecacollege.ca/~murray.saululi101/uli101files/uli101_week6_practice.docx
Your instructor may take-up these questions during class. It is up to the student to attend classes in order to obtain the answers to the following questions. Your instructor will NOT provide these answers in any other form (eg. e-mail, etc).
'''Review Questions:'''
# xWrite a Linux command to copy a file in the current directory called '''mytext.txt''' from your Matrix account to your account called '''user1'''<br>on the Linux server domain name called '''tech.myserver.com''' to that user’s home directory.# x Write a Linux command similar to the previous question, but rename the file on the remote Linux server to '''yourtext.txt''' # xWrite a Linux command to copy a file called '''~/project/linux.txt''' to the remote server called '''linux.techie.org'''<br>(your username for this remote server is the same username for your local server).<br><br># xWrite a Linux command to connect to the username '''saulm''' for the server domain name '''tux.senecac.on.ca''' to transfer files between Linux servers.# xAssuming that you are connected to that server in ''question #4''. What is the sftp command to display your current working directory on your local server?# xAssuming that you are connected to that server in ''question #4''. What is the sftp command to view files in your local server?<br>What is the sftp command to view files in your remote server?# xAssuming that you are connected to that server in ''question #4''. What is the sftp command to <u>download</u> the file answers.txt from the current directory of your remote server?# Assuming that you are connected to that server in ''question #4''. What is the sftp command to <u>upload</u> the file questions.txt from your local server to the '''~/documents/tests''' directory on your remote server?# xAssuming that you are connected to that server in ''question #4''. What is the sftp command to quit your current session?<br><br># Write a Linux command to send the attached file '''message.txt''' to the email address '''murray.saul@senecacollege.ca''' with the subject line: '''Important Message'''# Create a '''table''' listing each Linux command, useful options that were mentioned in the online assignment #1 and command purpose for the following Linux commands: '''scp''' , '''sftp''' , '''mail'''.# Create a '''table''' listing each '''sftp command''' and it's purpose. _________________________________________________________________________________ Author: Murray Saul License: LGPL version 3Link: https://www.gnu.org/licenses/lgpl.html _________________________________________________________________________________
[[Category:ULI101]]