Transferring files using SCP (Secure Copy Protocol) between Raspberry Pi devices is a straightforward process that allows for secure file transfers over SSH. Here's how you can transfer files between two Raspberry Pi devices using SCP:
Step 1: Open a Terminal on the Source Raspberry Pi:
- Open a terminal window on the Raspberry Pi from which you want to transfer the files.
Step 2: Use SCP Command:
- Use the scp command to copy a file from the source Raspberry Pi to the destination Raspberry Pi. The basic syntax is:
scp /path/to/source/file username@destination_ip:/path/to/destination/folder
Replace:
- /path/to/source/file with the path to the file you want to transfer.
- username with the username on the destination Raspberry Pi.
- destination_ip with the IP address of the destination Raspberry Pi.
- /path/to/destination/folder with the path on the destination Raspberry Pi where you want to save the file.
Step 3: Enter SSH Password:
- You will be prompted to enter the password for the destination Raspberry Pi's username during the transfer process.
Example:
- To copy a file named example.txt from the /home/pi directory on the source Raspberry Pi to the /home/pi/Documents directory on the destination Raspberry Pi with IP address 192.168.1.100, you would use the following command:
scp /home/pi/example.txt pi@192.168.1.100:/home/pi/Documents
Step 4: Verify File Transfer:
- Once the transfer is complete, you can verify that the file has been successfully copied to the destination Raspberry Pi by checking the specified destination folder.
By following these steps and adjusting the file paths, usernames, and IP addresses according to your setup, you can easily transfer files between Raspberry Pi devices using SCP in a secure and efficient manner.