How to Enable SSH on Raspberry Pi and Connect Remotely
January 1, 2026 | 7 minutesIn This Post
To SSH into a Raspberry Pi, enable its SSH server, connect it to your network, and run ssh username@hostname.local from your other computer. Use the username and hostname you configured for the Pi. If the hostname doesn't resolve, connect using the Pi's IP address instead.
I use SSH to update my Raspberry Pi kiosks and wall displays without digging out a keyboard or crawling behind a screen. The setup you need depends on whether you're preparing a new installation or already have a Pi running:
- New installation, including headless setup: use Raspberry Pi Imager to configure the account, network, and SSH together.
- Pi already running with terminal access: enable SSH with raspi-config.
- Existing installation without a screen: use the boot-partition method, provided the user account and network are already configured.
- SSH is enabled but you can't connect: jump to troubleshooting.
These instructions are for Raspberry Pi OS and a connection within your local network. Raspberry Pi's remote-access documentation covers the supported setup methods.
What You'll Need
Disclosure: I get commissions for purchases made through affiliate links in this post.
- A Raspberry Pi with networking support
- A microSD card or other boot media for Raspberry Pi OS
- A power supply suitable for your Pi model
- Another computer on the same local network
- A card reader if you're preparing or editing the microSD card on that computer
If your Pi already runs a project, you don't need to reinstall its OS to enable SSH. Writing an image with Imager erases the selected storage device, so use the existing-installation methods below to keep your files.
Setting Up SSH
Option 1: Enable SSH via Raspberry Pi Imager
For a fresh installation, I prefer configuring everything before the Pi first boots:
- Open Raspberry Pi Imager on your computer. Select your Pi model, Raspberry Pi OS, and the storage device you want to write.
- Under Customisation, choose a hostname and create your username and password. Save these; you'll use them to connect.
- Configure Wi-Fi if needed, or plan to connect the Pi to your router with Ethernet.
- Under Customisation → Remote Access, enable SSH. Choose password authentication to use the account you just created, or public-key authentication if you already have an SSH key configured for this computer.
- Review the selected storage device, write the image, and let verification finish. Eject the card, insert it into the Pi, connect Ethernet if applicable, and power it on.
The Imager guide includes screenshots of these settings. Older Imager releases used an Advanced Settings or OS Customisation dialog, so the labels may look different.
Option 2: Enable SSH from the Desktop
On an existing Pi, open a terminal on the Raspberry Pi and run:
1sudo raspi-config
Select Interface Options → SSH → Yes, then finish. Some versions label the menu Interfacing Options. This works from a local console on Raspberry Pi OS Lite too; a desktop isn't required.
Use your existing Pi account when you connect. Running this command on your laptop won't enable SSH on the Pi.
Option 3: Enable SSH Headlessly (No Screen)
If the Pi already has a user account and working network configuration:
- Shut down the Pi before removing its microSD card.
- Insert the card into your other computer and open the boot partition, commonly named
bootfs. - Create an empty file named
sshat the top level of that partition. Check that your editor hasn't added a.txtextension. - Eject the card, put it back in the Pi, and boot it.
The file enables SSH; it doesn't create a login or configure Wi-Fi. For a fresh image, use Imager or follow Raspberry Pi's manual headless setup, which also provisions a user with userconf.txt. Adding only the ssh file isn't a complete first-boot setup.
Connecting via SSH
Open Terminal on macOS or Linux, or PowerShell in Windows Terminal on Windows. Run the connection command on that computer, using your Pi's account and hostname. For example, if you created the user alex and named the Pi wall-display:
1ssh alex@wall-display.local
Replace both example names with your own. If you're using an IP address, the command looks like this:
1ssh alex@192.168.1.42
On the first connection, SSH asks you to trust the host key. Confirm you're connecting to your Pi; for a fingerprint check, compare the displayed fingerprint with the Pi's host public key through a trusted local console. For example, for its Ed25519 host key, run ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub on the Pi. Then accept the matching key.
Enter your Pi account's password, not your laptop password. Password entry doesn't show characters as you type. A successful login gives you a shell on the Pi; run hostname to check which machine you're on. Type exit when you're finished.
Find the Pi's IP Address
Your router's connected-device list is useful when you don't have a screen attached. Look for the hostname you configured. If you can open a terminal on the Pi, run:
1hostname -I
Use its address on the network shared with your other computer. Running this command on the other computer won't tell you the Pi's address. See Raspberry Pi's IP-address guide for other options.
Troubleshooting Raspberry Pi SSH
Start with the exact error message. A name-resolution problem needs a different fix from a rejected password.
Could Not Resolve Hostname
Check the hostname spelling, including .local. If the name still doesn't resolve, find the Pi in your router's device list and try its IP address. If that works, you can focus on local name resolution rather than changing SSH settings.
Connection Timed Out
Check that the Pi has finished booting and is connected to the network. Confirm its current IP address; an old address may belong to another device now. Guest Wi-Fi, client isolation, or a VPN can prevent communication between devices even when both have internet access. Try a network where the devices can reach each other.
Connection Refused
Recheck the address first. If it belongs to your Pi, use a local terminal to enable SSH with sudo raspi-config. A refused connection commonly means no SSH server is listening at that address and port; repeatedly changing the password won't fix that.
Permission Denied
Check the username before resetting anything. Current Raspberry Pi OS doesn't provide a default pi account with the password raspberry. Use the account you created.
If the error specifies publickey, check whether you selected key authentication in Imager and whether you're connecting from the computer holding the matching private key. A password won't substitute for that key when password authentication is disabled.
For more detail, add OpenSSH's verbose option:
1ssh -v alex@wall-display.local
Replace the example account and hostname. The output helps distinguish connection problems from authentication failures.
Remote Host Identification Has Changed
This can happen after reinstalling Raspberry Pi OS, but don't assume that is the cause. Verify the device and its new host-key fingerprint through a trusted route first.
After confirming the change is expected, remove the old entry for the exact hostname or IP address you used:
1ssh-keygen -R wall-display.local
Reconnect and verify the new key. The ssh-keygen manual explains this option; it removes a host's saved key rather than disabling host verification.
Final Thoughts
Once SSH works, you can update scripts, view logs, and reboot the Pi from your laptop. For a wall display, the next steps are setting up Raspberry Pi kiosk mode and making your Node.js app start automatically on boot.
Frequently Asked Questions
How do I enable SSH on a Raspberry Pi without a monitor?
For a new installation, use Raspberry Pi Imager to configure a user account, Wi-Fi or Ethernet, and SSH before booting. On an existing installation with a configured user and network, you can enable SSH by creating an empty file named ssh in the boot partition.
What is the default SSH username and password for Raspberry Pi?
Current Raspberry Pi OS has no default username or password. Use the account you created during setup; pi and raspberry only apply to older installations that retained those credentials.
How do I find my Raspberry Pi's IP address for SSH?
Check your router's connected-device list, or run hostname -I in a terminal on the Pi. If local hostname resolution works on your network, you can connect using the hostname you configured followed by .local instead.

