Coding on iPad with Termius
My best tips for how to code effectively on an iPad by remotely connecting to your dev machine with SSH.
Justin Wyne / November 5, 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:
1ssh-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.
1sudo -E vi /etc/ssh/sshd_config
And make sure the following values are set
1# To disable tunneled clear text passwords, change to no here!2PasswordAuthentication no3PermitEmptyPasswords no45# Change to no to disable s/key passwords6ChallengeResponseAuthentication no78UsePAM 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:
1t () {2tmux -u attach || tmux -u new3}
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 background2hi Normal guibg=NONE ctermbg=NONE