>_ Malvek

How to SSH into a Raspberry Pi from your iPhone

Enable SSH on the Pi, connect from your phone, switch to key-based login, and move files over SFTP. About ten minutes, start to finish.

1. Turn on SSH on the Pi

SSH is off by default on Raspberry Pi OS. Pick whichever fits:

sudo systemctl enable --now ssh

Then find the Pi's address on your network:

hostname -I

The first address it prints, something like 192.168.1.42, is what your phone will connect to. Your iPhone needs to be on the same Wi-Fi network.

2. Connect from your iPhone

This guide uses Malvek, a free SSH and SFTP app for iPhone, but the steps are similar in any SSH client.

  1. Open the Hosts tab and tap +.
  2. Give it a label (say, Pi), enter the address from step 1 as the Hostname, leave Port at 22, and enter your Username.
  3. Choose Password, enter the Pi's password, and tap Save.
  4. Tap the host to open a terminal.
  5. The first time, Malvek shows the Pi's host key fingerprint and asks whether to trust it, the same check the ssh command makes. Tap Trust & continue. If that fingerprint ever changes later, you'll get a red warning.

3. Switch to key-based login

Passwords work, but a key is both safer and quicker, since you never type anything.

  1. Open the Keys tab, tap Generate key, and name it. Malvek creates an Ed25519 key on the phone. The private half stays in the iOS Keychain.
  2. Tap the new key and tap Copy to copy its public key.
  3. In your Pi terminal session, add it to the authorized keys (paste the copied key between the quotes):
mkdir -p ~/.ssh && chmod 700 ~/.ssh
echo 'PASTE-PUBLIC-KEY-HERE' >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
  1. Back on the Hosts tab, edit the Pi, choose Private key, tap Saved key, pick the key you generated, and tap Save.
  2. Disconnect and connect again. You should get straight in with no password prompt.

The SSH key guide covers importing a key you already have, and what to do if you lose the phone.

Optional hardening: once key login works, you can turn off password logins by setting PasswordAuthentication no in /etc/ssh/sshd_config and running sudo systemctl restart ssh. Test that your key works first, or you can lock yourself out.

4. Copy files with SFTP

Long-press the host and choose Browse files. You can move around the Pi's file system, see Unix permissions, and upload or download files without leaving the app. SFTP runs over the same SSH connection, so there's nothing extra to set up on the Pi. The file transfer guide covers uploads, downloads and saving to the Files app.

Troubleshooting

Get Malvek on the App Store vs. Termius & Blink Support