Open main menu

CDOT Wiki β

Changes

Tutorial6: File Transfer / Sending Email Messages

3,380 bytes added, 07:18, 24 January 2021
Using sftp from Command Line Terminal of OS
# 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>[[Image:sftp-commands.png|thumb|right|350px|Common '''sftp''' commands.]]
# You should be in the '''sftp command prompt''' where you are expected to issue '''sftp commands'''.<br>Please take a moment to common ''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;">!pwd</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 server:<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 server.<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 server 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 '''!pwd''' ''sftp command'' to confirm that your current working directory on your local server is your home directory.<br><Br># Issue the following ''sftp command'' to create the following directory on your local server:<br><span style="color:blue;font-weight:bold;font-family:courier;">!mkdir local2</span><br><br># Issue the following ''sftp command'' to change to the '''local2''' directory on your local server:<br><span style="color:blue;font-weight:bold;font-family:courier;">lcd local2</span><br><br># Issue the '''!pwd''' ''sftp command'' to confirm you have changed to the ''local2'' directory on your local server.<br><br>Let's learn to <u>download</u> a file from your remote server to your local server.<br><br># Issue the following '''sftp command''' to transfer your '''thefile.txt''' file from your remote directory on your local server:<br><span style="color:blue;font-weight:bold;font-family:courier;">get thefile.txt</span><br><br># Issue the '''!ls''' '''sftp command''' to confirm that you transferred/copied the file: thefile.txt on your local server.<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>
-->
 
=== Using a Graphical sftp Application in MS Windows ===
13,420
edits