How to SSH to a Raspberry Pi on iPhone, iPad or Mac

To SSH to a Raspberry Pi on iPhone, turn on SSH on the Pi (in Raspberry Pi Imager or with sudo raspi-config), put the iPhone on the same Wi-Fi, and connect from an SSH app to raspberrypi.local or the Pi's IP address with the user you created. If the name does not work, allow the app under Settings, Privacy & Security, Local Network, or use the IP address from your router. Away from home, use a VPN such as Tailscale instead of opening port 22.

How to SSH to a Raspberry Pi on iPhone in six steps

A Raspberry Pi runs the same OpenSSH as any Linux server, so your phone needs nothing special. The steps:

  1. Turn on SSH on the Pi and create a user.
  2. Find its address: raspberrypi.local or an IP such as 192.168.1.42.
  3. Connect from the iPhone, iPad or Mac with that user.
  4. Allow the SSH app on the local network if iOS asks.
  5. Replace the password with a key.
  6. For access from outside, add a VPN instead of opening a port.

Each step is below, with the fix for the problems people hit most.

Is SSH turned on on your Raspberry Pi?

Raspberry Pi OS ships with SSH off, and there is no default pi user any more. Pick the way that fits where you are:

  • New SD card: in Raspberry Pi Imager, under Customisation, set a username and password, then turn on Enable SSH in Remote Access. You can paste a public key there too.
  • Pi with a screen: run sudo raspi-config, choose Interface Options, then SSH.
  • Card already written, no screen: create an empty file named ssh on the boot partition and start the Pi.

Each method, step by step, is in how to enable SSH on a Raspberry Pi.

How do you find your Raspberry Pi's IP address?

Try the name first. Raspberry Pi OS announces itself on the local network, so the hostname you chose in Imager followed by .local works without knowing the IP:

ping raspberrypi.local

If that fails, find the IP another way:

WhereHow
Your routerOpen its admin page and look in the list of connected devices for the Pi's hostname.
The Pi itselfhostname -I prints its addresses.
A Mac or Linux computersudo nmap -sn 192.168.1.0/24 scans the network; with sudo it shows the maker, so look for Raspberry Pi. Change the range to match your network.
A Mac, quicklyarp -a lists the devices your Mac has talked to recently.

Once you know the IP, reserve it in the router's DHCP settings so it stays the same after a restart.

In Wardterm, you can skip the hunt: on a new server, the Wi-Fi button in the Address field opens Find on this network…, which lists the devices near you that offer SSH. Tap the Pi to fill in its address. See Add and edit servers.

Connect from iPhone, iPad or Mac

On a Mac, Terminal is enough:

ssh you@raspberrypi.local

Replace you with the user you created. On iPhone and iPad, in Wardterm:

  1. Open the Vaults tab, then Servers, choose +, then New server.
  2. Fill in Address (raspberrypi.local or the IP) and User. Leave the port at 22.
  3. Type the password, or leave it empty to be asked when you connect.
  4. Choose Connect. The first time, the app shows the Pi's fingerprint: choose Trust and connect.

For a one-off test, type ssh you@raspberrypi.local in the filter at the top of the Servers list and tap Connect to. The key bar above the keyboard gives you Esc, Ctrl, Tab and the arrows, which you need for nano and htop.

Why can't your iPhone SSH into the Raspberry Pi?

When the Mac connects and the iPhone does not, it is almost always one of these:

  • Local Network permission. iOS asks once whether an app may reach devices on your network. If you said no, local addresses fail with No route to host. Fix it in Settings, Privacy & Security, Local Network, and turn the app on.
  • Different networks. A guest Wi-Fi or a mesh node in isolation mode keeps devices apart. Put the phone on the same network as the Pi.
  • A VPN on the phone. Some VPNs send all traffic away, local addresses included. Turn it off for a moment to test.
  • The wrong name. If you renamed the Pi in Imager, raspberrypi.local no longer exists: use your hostname plus .local, or the IP.
  • A reinstalled Pi. A fresh SD card means a new host key, and the app stops with a changed-key warning. That is expected after a reinstall: remove the old fingerprint and connect again.

The app's message tells you which case you are in, and No route to host has the steps for each.

Use an SSH key instead of the password

A key is faster on a phone, since there is nothing to type, and it lets you turn off password logins later.

From a Mac:

ssh-keygen -t ed25519 -C "mac"
ssh-copy-id you@raspberrypi.local

From the iPhone, make the key in the app. In Wardterm, open Keys and choose Key on This Device for a key made in the secure chip of the phone, confirmed with Face ID, or Generate key for a normal Ed25519 key. Open the key, choose Add to a server, pick the Pi, then Use to sign in. More on chip-held keys in SSH keys in the Secure Enclave.

Once every device signs in with a key, follow how to disable SSH password login. Keep one session open while you do it.

How do you SSH into your Raspberry Pi from outside your home?

raspberrypi.local and 192.168.1.42 only work at home. To reach the Pi from a café or on cellular data, two options are easy and safe:

  • Tailscale. Install it on the Pi and on the iPhone, sign in to the same account on both, and the Pi gets an address that works from anywhere. On the Pi:
    curl -fsSL https://tailscale.com/install.sh | sh
    sudo tailscale up
    Then use the Pi's Tailscale name or 100.x address as the server address.
  • Raspberry Pi Connect. Raspberry Pi's own service gives you a remote shell in the browser, with nothing to set up on the router.

Avoid forwarding port 22 from your router to the Pi: bots scan the whole internet for it and start guessing passwords. The longer comparison is in how to access a home server remotely, and the background in SSH without a public IP.

Keep the session alive with Mosh or tmux

Phones sleep, and plain SSH drops when they do. Install both tools on the Pi:

sudo apt install mosh tmux
  • Mosh keeps the session through a switch from Wi-Fi to cellular data and through sleep. In Wardterm, open the server, choose Show more, Connection, and set Mosh to On. See Mosh.
  • tmux keeps programs running on the Pi after you disconnect. In Wardterm, save tmux new -A -s main as the server's startup command and every connection lands in the same session.

No network at all? Use the serial console

When the Pi does not join the Wi-Fi, SSH cannot help. The serial console still can:

  1. On the Pi, run sudo raspi-config, choose Interface Options, then Serial Port, and answer Yes to a login shell over serial. On a Pi 5, which uses a separate debug connector, add enable_uart=1 to /boot/firmware/config.txt to use the GPIO pins.
  2. Connect a 3.3 V USB serial adapter: its RX to GPIO 14 (pin 8), its TX to GPIO 15 (pin 10), and ground to ground. A 5 V adapter can damage the Pi.
  3. Open the port at 115200 baud from a computer. On a Mac: screen /dev/tty.usbserial-XXXX 115200, with the name from ls /dev/tty.usb*.

Wardterm on the Mac has a Serial protocol for this, with the port and speed in the server form. See serial terminal and serial console from a Mac.

Questions

How do I SSH into a Raspberry Pi from my iPhone?

Turn on SSH on the Pi, connect the iPhone to the same Wi-Fi, and open an SSH app. Add a server with the address raspberrypi.local (or the hostname you chose, or its IP), your Pi user and password, then connect and accept the fingerprint.

What is the default username and password for SSH on a Raspberry Pi?

There is none on current Raspberry Pi OS. You create the user and password in Raspberry Pi Imager, or on first boot. The old pi and raspberry login is gone.

Why is raspberrypi.local not working on my iPhone?

Usually the SSH app has no Local Network permission: turn it on in Settings, Privacy & Security, Local Network. Also check that both devices are on the same network, not a guest Wi-Fi, and that you use the hostname you set, followed by .local.

How do I find my Raspberry Pi's IP address?

Look for it in your router's list of connected devices, run hostname -I on the Pi, or scan the network from a computer with sudo nmap -sn 192.168.1.0/24, which names Raspberry Pi devices by their maker.

Which SSH app for iPhone works with a Raspberry Pi?

Any SSH client does, since the Pi runs standard OpenSSH. Look for SSH keys made on the phone, a key bar with Ctrl and Esc, and Mosh for when the phone sleeps. Wardterm has all of these.

Can I SSH to my Raspberry Pi outside my home network?

Yes. Install Tailscale on the Pi and the iPhone and connect to the Pi's Tailscale name from anywhere, or use Raspberry Pi Connect for a shell in the browser. Avoid forwarding port 22 on your router.

Does Mosh work with a Raspberry Pi?

Yes. Run sudo apt install mosh on the Pi and turn on Mosh for that server in your SSH app. The session then survives the switch from Wi-Fi to cellular data and the phone going to sleep.

How do I connect to a Raspberry Pi with no network?

Use the serial console. Turn it on with sudo raspi-config, then connect a 3.3 V USB serial adapter to GPIO 14, 15 and ground, and open it at 115200 baud from a computer.

Sources

Each page was read on the date shown. Prices and features change, so check the maker's page before you decide.

  1. Raspberry Pi documentation, remote access, read on
  2. Raspberry Pi documentation, configuration (UART and serial console), read on
  3. If an app would like to connect to devices on your local network, Apple Support, read on
  4. Download Tailscale for Linux, read on
  5. Wardterm docs, add and edit servers, read on
  6. Wardterm docs, no route to host and Local Network, read on
  7. Wardterm docs, Mosh, read on

All posts