Back to posts
Coding on iPad with Termius

Coding on iPad with Termius

TBD

Justin Wyne / November 6, 2023

Introduction

Below are instructions on how to set up a pleasant terminal experience on the iPad using a remote ssh server such as your home mac computer.

This is a screenshot of the Termius app on iPadOS running a tmux session on my iMac.

SSH from iPad

Termius is a great looking a full featured freemium cross platform ssh client.

The steps below can all be done with the free version of the app; none of this requires the paid features.

SSH Keys

On your ssh server:

 
1
ssh-keygen -t ed25519

The output will be your private and public key.

  • id_ed25519 - private
  • id_ed25519.pub - public

Air drop the private key to your iPad and append the contents of the .pub public key into ~/.ssh/authorized_keys

Securing SSH

To secure your SSH, you should start by disabling password authentication.

 
1
sudo -E vi /etc/ssh/sshd_config

And make sure the following values are set

/etc/ssh/sshd_config 
1
# To disable tunneled clear text passwords, change to no here!
2
PasswordAuthentication no
3
PermitEmptyPasswords no
4
5
# Change to no to disable s/key passwords
6
ChallengeResponseAuthentication no
7
8
UsePAM no

Optional: iOS Secure Enclave

To go a step further with security, you can remove the risk of mishandling the private key from the previous steps by generating a completely new private key that not even the Termius app has access to and requires FaceID for use.

Sessions with TMUX

Use tmux to keep your session alive between disconnects.

I’ll leave it to you to set up your own perfect tmux configuration, but here’s a few key snippets that made it seamless for me.

In my shell config, I created a helpful one character function that will dynamically create a new tmux session or start a new one of non exist:

 
1
t () {
2
tmux -u attach || tmux -u new
3
}

Tip: Styling

Make vim background transparent to better match the Termius client.

To do so, just add this in your vim config, below setting your colorscheme:

 
1
" Transparent background
2
hi Normal guibg=NONE ctermbg=NONE