How does Raspberry pi 3 transfer data

Transfer files to the Raspberry Pi without FTP using SSH.

Ⓘ This article may have been partially or fully translated using automatic tools. We apologize for any mistakes.

I'm sure you had to transfer files from your PC to your Raspberry Pi over the network before. In this case, you probably had to install an FTP server. And yet there was a much easier way ...

In this tutorial you will learn how to transfer files from our computer to our Raspberry Pi without having to install an FTP server, but only using the SSH server already installed on the Raspberry Pi and the command!

The material used in this tutorial

In this tutorial we will use the following material:

To complete this tutorial you will also need the Activated the SSH server of your Raspberry Pi. If you don't know how, check out our tutorial to enable SSH.

What is SCP Transferring Files Using SSH?

If you're using the Raspberry Pi, you've probably heard of SSH, a tool that lets you take control of a computer remotely from the command lines. But what you may not know is that SSH isn't just for that.

One of the many possible uses for SSH is SCP for Secure CoPy. This is a protocol for transferring files from one computer to another based on the SSH protocol, which encrypts the data being transferred.

For us who work with the Raspberry Pi, SCP is particularly interesting because the Raspberry Pi already has an integrated SSH server and we therefore do not have to install or configure a server, as is the case with FTP.

If you are new to SSH, be sure to read our SSH tutorial before proceeding. It's not essential, but I think it makes things clearer.

Transfer files from a Linux computer using SCP

If you're working from a Linux computer, nothing is easier than sending a file using SCP. Just use the command from your terminal.

The command is used as follows:

First you set the resource to be sent (there can be several separated by spaces) and at the end of the command where to send it.

Resources and goals are actually identified through paths. These can be simple file paths or credentials associated with file paths.

And it works like SSH, you enter a user account, a host, a path, you are asked for the account password, and if the password is correct then the file is transferred.

Some examples to better understand SCP paths.

To help you better understand how it works, here are some examples of SCP paths and commands.

In all of the following examples, files are sent and retrieved from a network-connected Raspberry Pi to the IP address and used with the standard user,.

send file from your PC to the directory the raspberry:

scp /home/bernard/photo.jpg [email protected]: / home / pi

Rescue file on the Raspberry Pi and copy it into the folder from your PC:

scp [email protected]: /home/pi/toto.txt / tmp

Transfer files and from your PC to the folder from your raspberry:

scp ~ / file1 ~ / file2 [email protected]: / home / pi

Finally, in a special case, transfer the entire file from your Raspberry Pi to a new folder in your PC:

scp -r [email protected]: / home / pi ~ / tmp_pi

Note the use of the argument This enables file transfer.

On Linux, nothing could be easier than transferring a file to or from your Raspberry Pi over the network using SCP!

Transfer files from Windows or Mac OS to the Raspberry Pi

On Windows or Mac OS, as is often the case, we don't transfer the files directly to the command lines, but instead use a graphical user interface.

We're actually going to be using a tool that you probably know if you've used an FTP server before, FileZilla. When FileZilla is originally an FTP client, it also functions as an SFTP and SCP client.

Go to the FileZilla download page, take the version appropriate for your system, install it there and launch the software.

Once FileZilla starts, click File, Site Manager. A window will open where you can manage your sites. If you run "New Site", you can enter the connection information to your Raspberry Pi in the right part.

Enter the IP address of your Raspberry Pi in the "Host" section (if you do not know this, you will find the IP address of your Raspberry Pi in our tutorial).

In the port part, enter the SSH port of your Raspberry Pi, by default 22.

Most importantly, in the Protocol section, select the SSH File Transfer Protocol "selectedt is. It is an SSH-based transfer protocol that replaces SCP and is supported by FileZilla.

Finally, for the “Authentication Type” part, choose “Normal” and enter your raspberry user. and your password.

All you have to do is click "Connect".

A message should appear asking you to verify the host server key. This is because, unlike FTP, SFTP uses SSH to encrypt data and therefore requires an encryption key. Click on "Validate".

And there you are, you are connected to your Raspberry Pi! You can now explore the filesystem just like your Pi user.

This means that you have the right to do anything your Pi user can do on the server. You can easily transfer files between your Raspberry Pi and your computer by simply dragging and dropping them!

Now it is your turn !