Skip to main content

How to send files to Raspberry Pi using SSH

What is SSH?

SSH stands for Secure Shell — it’s a network protocol that lets you securely log in to and control another computer remotely, usually over the internet or your local network.

Think of it as opening a remote terminal window on your Raspberry Pi from your laptop or another device.

What You Can Do with SSH:

  1. Run terminal commands on your Pi from another machine
  2. Transfer files (using scp, rsync, or SFTP)
  3. Install software, run Python scripts, update your system
  4. Control a headless Raspberry Pi (one without monitor/keyboard)

Enable SSH on Raspberry Pi

Option 1: Using Raspberry Pi OS with Desktop

  • Go to Preferences → Raspberry Pi Configuration
  • Under the Interfaces tab, enable SSH
  • Reboot afterwards, sudo reboot

Option 2: If You’re Using Pi Headless

  • Put a file named ssh (with no extension) into the boot partition of the SD card
  • When the Pi boots, SSH will be enabled

Find Pi's IP address

  1. In Terminal, hostname -I
  2. You will see something that looks like this: 192.168.1.42, this is your pi's IP address

File Transfer

Make sure your computer is on the same network as the Pi.

1. From Your Computer → Raspberry Pi

scp /path/to/local/file pi@<raspberry_pi_ip>:/home/pi/

2. To Send a Whole Folder

scp -r /path/to/local/folder pi@<raspberry_pi_ip>:/home/pi/

3. From Raspberry Pi → Your Computer

scp pi@<raspberry_pi_ip>:/home/pi/somefile.txt /local/path/

Tips

  1. The default username is usually pi
  2. If SSH asks you to confirm the connection the first time, type yes
  3. If your Pi is using a custom SSH port (e.g. 2222), add -P 2222