How to SSH into a Raspberry Pi?
December 23, 2024

How to SSH into a Raspberry Pi?

SSH (Secure Shell) allows you to access the Raspberry Pi’s command line remotely over the Internet.

📌 1. Enable SSH Raspberry Pi

If SSH is not enabled:

  • Run the Raspberry Pi configuration tool:

`bash

sudo raspi-config`

`bash

sudo restart`

🔹Alternative method: Place an empty file named ssh (no extension) in the boot partition of the SD card. SSH will be enabled on boot.

📌 2. Find the IP address of Raspberry Pi

Run on your Raspberry Pi:

`bash

hostname-I`

Make a note of the IP address (eg 192.168.1.100).

📌 3. SSH from another device

On your computer (Linux, macOS, or Windows with an SSH client such as PowerShell or Command Prompt), execute:

`bash

sshpi@`

  • Replace with the IP address of your Raspberry Pi.
  • Default username: pi
  • Default password: raspberry (if not changed).

📌 4. Accept SSH fingerprint

When you connect for the first time, you’ll see:

`bash

Are you sure you want to continue connecting (Y/N)?

type:

`bash

Yes`

Enter your password when prompted.

📌 5. Use SSH with custom port (if changed)

If SSH is running on a non-default port (e.g. 2222):

`bash

ssh -p 2222 pi@`

📌 6. Exit SSH session

Once finished, exit the session using the following command:

`bash

Exit`

✅ You are now connected to your Raspberry Pi via SSH! 🚀

2024-12-23 09:55:44

Leave a Reply

Your email address will not be published. Required fields are marked *