Unable to Connect Raspberry Pi 4 via SSH using Mac: Fresh Ubuntu Desktop 23.10 Installation

Abstract: Resolve SSH connection failures between Mac and Raspberry Pi 4 running Ubuntu Desktop 23.10 by enabling the SSH service and verifying network settings.

Created: 2026-10-21 by

Connecting a Raspberry Pi 4 running Ubuntu Desktop 23.10 to a Mac via SSH often fails due to disabled services or network isolation. This guide resolves the issue by enabling the SSH server on the Pi, verifying network connectivity, and configuring macOS terminal settings for a stable connection.

Enable SSH on Ubuntu Desktop

Ubuntu Desktop does not enable the SSH daemon by default to save resources and improve security out of the box. You must explicitly activate this service before your Mac can establish a connection. First, access the Raspberry Pi directly using a monitor, keyboard, and mouse, or connect via a local Ethernet cable if Wi-Fi is unstable. Open the terminal application on the Pi. To ensure the SSH service starts automatically upon boot, run the following command:
sudo systemctl enable ssh
Next, start the service immediately without waiting for a reboot:
sudo systemctl start ssh
Verify that the service is active and running by checking its status:
systemctl status ssh
You should see an "active (running)" message in green text. If the service is inactive, check for errors using journalctl -xeu ssh. Note that on some minimal installations, you may need to install the package first with sudo apt install openssh-server, though Ubuntu Desktop usually includes it pre-installed.

Identify the Raspberry Pi's IP Address

Your Mac needs the specific IPv4 address of the Raspberry Pi to initiate the connection. Since both devices are likely on the same local network, finding this address is straightforward. On the Raspberry Pi terminal, use the ip command to display network interfaces:
ip addr show
Look for the interface connected to your network. If you are using Wi-Fi, look for wlan0; if using Ethernet, look for eth0. Under the relevant interface, find the line starting with inet. It will look something like inet 192.168.1.15. Record this IP address. Alternatively, you can use the hostname if your router supports mDNS resolution. In many home networks, you can reach the Pi using raspberrypi.local. Test this from your Mac terminal by pinging the address:
ping raspberrypi.local
If the ping returns replies, you can use ssh [email protected] instead of the numeric IP. However, numeric IPs are more reliable if DNS resolution is inconsistent.

Configure macOS Terminal Settings

macOS comes with OpenSSH client pre-installed, but users often encounter issues related to the shell environment or key authentication. Before attempting the connection, ensure your Mac is ready. Open the Terminal app on your Mac. If you are using zsh as your default shell, which is standard on newer macOS versions, ensure your path is correctly configured. If you previously encountered issues with SSH commands not being found, refer to our guide on Fixing zsh: command not found: ssh -Y on Mac Terminal. To test basic connectivity, try connecting with verbose output to see where the handshake might fail:
ssh -v [email protected]
Replace 192.168.1.15 with your Pi's actual IP address. The -v flag provides detailed logs. Look for lines indicating "Connection established" or "Authentications that can continue." If you see "Permission denied," the credentials are incorrect. If you see "No route to host," there is a network configuration issue.

Handle Authentication and User Permissions

Ubuntu Desktop typically creates a user named ubuntu during installation. Ensure you are using the correct username. If you created a different user during setup, replace ubuntu with your username in the SSH command. When prompted for a password, enter the password associated with that user account. If you have set up SSH keys, ensure your private key is accessible. You can specify a key file using the -i flag:
ssh -i ~/.ssh/id_rsa [email protected]
If you frequently connect, add an entry to your ~/.ssh/config file on the Mac to simplify future connections:
Host pi
    HostName 192.168.1.15
    User ubuntu
    IdentityFile ~/.ssh/id_rsa
After adding this, you can simply type ssh pi to connect.

Troubleshoot Network Isolation

If the connection times out, check your network settings. Some routers isolate devices on the same Wi-Fi network from communicating with each other, especially on guest networks. Ensure both your Mac and Raspberry Pi are on the same primary LAN segment. Additionally, verify that the firewall on the Raspberry Pi is not blocking port 22. While Ubuntu Desktop typically allows SSH through the default firewall, custom configurations might block it. Check the firewall status with:
sudo ufw status
If UFW is active, allow SSH traffic with:
sudo ufw allow ssh
If you recently changed network settings or had previous SSH issues, consider reviewing our article on Fixing Incoming SSH Connection Issue on macOS: Temporary Solution - Reboot, as a simple reboot of either device can clear stale network states.

Frequently Asked Questions

Why does SSH work on Linux but not on my Mac?

The SSH protocol itself is identical across platforms, so the difference lies in client configuration or network policies. macOS may have stricter firewall rules or key permissions. Ensure your Mac's firewall allows outgoing connections and that your SSH key has correct read permissions (600).

What if I forget the password for the ubuntu user?

If you cannot log in via SSH, you must reset the password physically. Boot the Raspberry Pi into recovery mode or use a live USB to mount the root filesystem and change the password using the passwd command. Alternatively, re-flash the SD card if data loss is acceptable.

Can I use port forwarding to connect from outside my home?

Yes, but it requires configuring your router to forward external port 22 to the Raspberry Pi's internal IP on port 22. For security, consider using a non-standard external port and setting up key-based authentication only, disabling password login entirely.

How do I know if the SSH server is actually listening?

Run netstat -tlnp | grep :22 or ss -tlnp | grep :22 on the Raspberry Pi. If you see a line listing LISTEN on port 22, the server is active and ready to accept connections. If nothing appears, the service is not running.

Is it safe to leave SSH enabled on my Raspberry Pi?

It is safe if you use strong passwords or SSH keys and keep your system updated. However, exposing SSH to the internet without proper security measures makes it vulnerable to brute-force attacks. Always disable password authentication in /etc/ssh/sshd_config and use keys instead.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More