Justin WyneComment

iPad Terminal with Termius and tmux

Justin WyneComment
iPad Terminal with Termius and tmux

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.

IMG_0065.png

Preview

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

Connecting with Termius ssh client for 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.

Create and set up an SSH Key

On your ssh server:

ssh-keygen -t ed25519

The output will be your private and public key.

id_ed25519
id_ed25519.pub

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

Secure your SSH by disabling password authentication

sudo -E vi /etc/ssh/sshd_config

And make sure the following values are set

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
PermitEmptyPasswords no

# Change to no to disable s/key passwords
ChallengeResponseAuthentication no

UsePAM no

Optional: Upgrade your SSH key to 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.

 
95CF2064-C943-437D-AED0-CA444D9F67E8_1_201_a.jpeg
65C62B6D-075A-47A0-8A86-D2F1AFA34889_1_105_c.jpeg
 
 
31AF7C28-16BE-4090-948E-24714D5ED2D0_4_5005_c.jpeg
743DD182-9D41-4BF3-A5DC-D2F15A3B216A_4_5005_c.jpeg
 

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:

t () {
	tmux -u attach || tmux -u new
}

Other Tips

Make vim background transparent to better match the Termius client.

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

" Transparent background
hi Normal guibg=NONE ctermbg=NONE