Difference between revisions of "SFTP"
Wesley-vuong (talk | contribs) |
Jeff-strong (talk | contribs) m (Editorial review and minor corrections) |
||
Line 3: | Line 3: | ||
== Prerequisites == | == Prerequisites == | ||
=== An SSH client === | === An SSH client === | ||
Linux and Mac operating systems have a built-in terminal that is a secure shell client. Windows users can either use puTTY or the | Linux and Mac operating systems have a built-in terminal that is a secure shell client. Windows users can either use puTTY or the '''secure shell extension''' on Google Chrome. This extension works on all ''Chromium''-based browsers like Opera. | ||
You will need an SSH client to download and upload files. We will be using the Google Chrome Extension in this demonstration. | You will need an SSH client to download and upload files. We will be using the Google Chrome Extension in this demonstration. | ||
== Starting the Secure Shell Chrome extension in SFTP mode == | == Starting the Secure Shell Chrome extension in SFTP mode == | ||
Click the Secure Shell Chrome Extension's icon and choose '''connection dialog''' | Click the Secure Shell Chrome Extension's icon and choose '''connection dialog'''. | ||
The connection string is in the | The connection string is in the | ||
'''firstname-lastname@host''' format | '''firstname-lastname@host''' format. | ||
To Connect to the Code Merlin server, | To Connect to the Code Merlin server, type in the following: | ||
{{ConsoleLine||queen-guinevere@ssh.codermerlin.com}} | {{ConsoleLine||queen-guinevere@ssh.codermerlin.com}} | ||
''' | To connect, click '''SFTP '''. | ||
{{Hint|FTP, SFTP, SSH and SFTP | {{Hint|FTP, SFTP, SSH and SFTP<br> | ||
SFTP is an improvement of the File Transfer Protocol (FTP) and FTPS (File Transfer Protocol with support for Transport Layer Security). FTP is unencrypted. FTPS is encrypted by either TLS or SSL. SFTP runs over SSH. In fact, it uses port 22 too. }} | |||
SFTP is an improvement of the File Transfer Protocol (FTP) and FTPS(File Transfer Protocol with support for Transport Layer Security. FTP is unencrypted. FTPS is encrypted by either TLS or SSL. SFTP runs over SSH. In fact, it uses port 22 too. }} | |||
== Uploading == | == Uploading == | ||
=== The PUT command === | === The PUT command === | ||
We will be using the PUT command to upload files (and directories) from a local computer to a remote server. | We will be using the PUT command to upload files (and directories) from a local computer to a remote server. | ||
The PUT command has | The PUT command has the following syntax: | ||
{{ConsoleLine||put <file> [ [ <file2> ... ] <directory>/[ <newname> ] ] }} | {{ConsoleLine||put <file> [ [ <file2> ... ] <directory>/[ <newname> ] ] }} | ||
All parameters except the {{ConsoleLine||<file>}} parameter are optional | All parameters except the {{ConsoleLine||<file>}} parameter are optional. | ||
You can specify the upload directory using the | You can specify the upload directory using the | ||
{{ConsoleLine||<directory>}} parameter. If no upload directory is specified, the file | {{ConsoleLine||<directory>}} parameter. If no upload directory is specified, the file is uploaded to the working directory. | ||
=== The MPUT command === | === The MPUT command === | ||
The MPUT command lets you upload multiple files simultaneously and has | The MPUT command lets you upload multiple files simultaneously and has the following syntax: | ||
{{ConsoleLine||mput filename1 filename2 filename3 ...}} | {{ConsoleLine||mput filename1 filename2 filename3 ...}} | ||
Line 35: | Line 34: | ||
{{Observe|:The RSYNC command| | {{Observe|:The RSYNC command| | ||
The {{ConsoleLine||rysnc}}command is used to upload a whole directory. It | The {{ConsoleLine||rysnc}} command is used to upload a whole directory. It is more powerful than the PUT and the MPUT commands because it uploads (syncs) only those files that have been altered. What is its syntax? }} | ||
=== Uploading === | === Uploading === | ||
Create file.txt on your computer | Create a file called file.txt on your computer.<br> | ||
Type put | |||
Browse for | Type put.<br> | ||
Confirm that the file has been uploaded with the '''ls''' command | |||
Browse for the file.<br> | |||
Confirm that the file has been uploaded with the '''ls''' command, which lists all directories and files in the working directory. | |||
Type {{ConsoleLine||ls}} | Type {{ConsoleLine||ls}} | ||
Line 53: | Line 55: | ||
=== Downloading === | === Downloading === | ||
To download the file you've just uploaded, type {{ConsoleLine||get file.txt}} | |||
<!-- Categories --> | <!-- Categories --> | ||
{{#set: Has primary media type=Text }} | {{#set: Has primary media type=Text }} | ||
[[Category:SFTP clients]] | [[Category:SFTP clients]] |
Revision as of 17:38, 16 March 2023
Introduction[edit]
SSH is a secure way of accessing servers. We will be using SSH to upload and download a file from Coder Merlin.
Prerequisites[edit]
An SSH client[edit]
Linux and Mac operating systems have a built-in terminal that is a secure shell client. Windows users can either use puTTY or the secure shell extension on Google Chrome. This extension works on all Chromium-based browsers like Opera. You will need an SSH client to download and upload files. We will be using the Google Chrome Extension in this demonstration.
Starting the Secure Shell Chrome extension in SFTP mode[edit]
Click the Secure Shell Chrome Extension's icon and choose connection dialog. The connection string is in the firstname-lastname@host format. To Connect to the Code Merlin server, type in the following:
queen-guinevere@ssh.codermerlin.com
To connect, click SFTP .
SFTP is an improvement of the File Transfer Protocol (FTP) and FTPS (File Transfer Protocol with support for Transport Layer Security). FTP is unencrypted. FTPS is encrypted by either TLS or SSL. SFTP runs over SSH. In fact, it uses port 22 too.
Uploading[edit]
The PUT command[edit]
We will be using the PUT command to upload files (and directories) from a local computer to a remote server. The PUT command has the following syntax:
put <file> [ [ <file2> ... ] <directory>/[ <newname> ] ]
All parameters except the
<file>
parameter are optional.
You can specify the upload directory using the
<directory>
parameter. If no upload directory is specified, the file is uploaded to the working directory.
The MPUT command[edit]
The MPUT command lets you upload multiple files simultaneously and has the following syntax:
mput filename1 filename2 filename3 ...
rysnc
Uploading[edit]
Create a file called file.txt on your computer.
Type put.
Browse for the file.
Confirm that the file has been uploaded with the ls command, which lists all directories and files in the working directory.
Type
ls
Downloading[edit]
The GET command[edit]
The get command lets you download one or more files from a remote server to a local computer. It has the following syntax:
get <file> [ [ <file2> ... ] <directory>\[ <newname> ] ]
Downloading[edit]
To download the file you've just uploaded, type
get file.txt