DEV Community

Hedy
Hedy

Posted on

How to SSH into a Raspberry Pi?

SSH (Secure Shell) allows you to remotely access your Raspberry Pi's command line over a network.

Image description

πŸ“Œ 1. Enable SSH on Raspberry Pi

If SSH isn’t enabled:

  • Run the Raspberry Pi configuration tool:

`bash

sudo raspi-config`

  • Navigate to:
    Interfacing Options β†’ SSH β†’ Enable

  • Confirm and exit.

  • Reboot the Raspberry Pi if necessary:

`bash

sudo reboot`

πŸ”Ή Alternative Method: Place an empty file named ssh (no extension) in the boot partition of your SD card. SSH will be enabled on boot.

πŸ“Œ 2. Find the Raspberry Pi's IP Address

On your Raspberry Pi, run:

`bash

hostname -I`

Take note of the IP address (e.g., 192.168.1.100).

πŸ“Œ 3. SSH from Another Device

On your computer (Linux, macOS, or Windows with an SSH client like PowerShell or Command Prompt), run:

`bash

ssh pi@`

  • Replace with your Raspberry Pi's IP address.
  • Default username: pi
  • Default password: raspberry (if unchanged).

πŸ“Œ 4. Accept SSH Fingerprint

The first time you connect, you'll see:

`bash

Are you sure you want to continue connecting (yes/no)?`

Type:

`bash

yes`

Enter your password when prompted.

πŸ“Œ 5. SSH Using a 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

When you're done, exit the session with:

`bash

exit`

βœ… You’re now connected to your Raspberry Pi via SSH! πŸš€

πŸ‘‹ One new thing before you go

Tired of getting nickel-and-dimed on your software career? πŸ˜’

We have created a membership program that helps cap your costs so you can build and experiment for less. And we currently have early-bird pricing which makes it an even better value! πŸ₯

Just one of many great perks of being part of the network ❀️

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay