In this guide
SSH
Run commands and move files on a server or computer you can sign in to with SSH, straight from Apple Shortcuts.
What you can do #
SSH is how you sign in to a server or computer to run commands, the same way you would in a terminal. Use this integration for a home server, a Raspberry Pi, a NAS, or a server you rent. If you want to control a Mac, the Mac integration has ready-made actions.
You can run any command and get back what it printed, upload a file from your shortcut, download a file into your shortcut, and list what is in a folder. Shortcutify signs in, does the one thing, and signs out again.
Connect SSH #
- In Shortcutify, open Services → SSH and tap Add a Server.
- Enter the server’s address, such as example.com or an IP address, and the user to sign in as. Fill in Port only if the server doesn’t use 22.
- Under Sign In, choose Password and enter it, or choose Key (see below).
- Tap Connect. You see Connected to and the server’s name when it works. If the server is on your home network, allow local network access when iPhone asks.
Choose Key, then Make a Key on This iPhone, and run the line under Run once on the server on the server once. It adds the key to the server’s list of allowed keys. Then tap Connect. You can also choose Paste a Private Key for an existing Ed25519 key in OpenSSH format, with its passphrase if it has one.
Shortcutify remembers the server’s identity the first time it connects, shown under Server Identity. If a different machine later answers at that address, actions stop instead of signing in. Tap Forget Server Identity only after you reinstall or replace the server.
Example: run a command with a value from your shortcut #
- In Actions, tap +, choose SSH, then Run Command.
- Open Command and type a command, such as uptime. To use a value from your shortcut inside the command, tap {} and insert Param 1 where it belongs.
- In Output, open Returned Value and choose output, so Shortcuts gets what the command printed as Text.
- Tap Run Test, then name and save the action. In Apple Shortcuts, add Execute Action, choose the action, and fill in Param 1 if you used it.
A command that ends with an error stops the action and shows its message. To keep going and decide yourself, turn off Stop on Failure: the action then returns exitCode, which is 0 when the command succeeded, along with errorOutput.
Choose the right task #
Several servers
Tap Add a Server for each one and give it a Name. When you choose an SSH action, pick the server at the top of the list. Each step remembers its server; change it with the Server row in the step.
Run Command
Runs the command in the user’s shell, starting in their home folder. Returns output, errorOutput and exitCode. Values you insert with {} are pasted into the command as they are, so only insert values you trust.
Upload File
Bind File to File 1 and give a Destination. A destination ending in / is a folder and the file keeps its name; anything else is the new file’s full path. ~/ means the home folder. An existing file is replaced.
Download File
Give the file’s Path. The file comes back as the result’s File. Text files up to 1 MB are also returned as text, so you can read them without another block. In Shortcuts, tap the Execute Action result where you use it, such as in the next block, and choose File.
List Folder
Lists the files and folders in a folder, folders first. Leave Folder empty for the home folder. Each item has a name, path, size, modified date, and whether it is a folder.
If something does not work #
Shortcutify can’t reach the server
Check the address and port, and that the server’s SSH service is running. A server at home is reachable only from the same network, unless you use a VPN such as Tailscale and enter the server’s Tailscale name.
The server refused to sign me in
Check the user name and password, or that the Make a Key line ran on the server for that same user. Some servers turn password sign-in off and accept only keys.
My key is refused
Make a key in Shortcutify instead. It makes an Ed25519 key, which every current server accepts. Pasted RSA keys are refused by current OpenSSH servers, because Shortcutify signs them in an older way. Keys in the older “BEGIN RSA PRIVATE KEY” format need converting with ssh-keygen -p -f yourkey.
The command works in Terminal but not here
Shortcutify runs one command without a terminal. Programs that wait for typed input or a password prompt, such as sudo asking for a password, stop after 30 seconds. Commands that change directory only last for that command; use full paths.
It says the server answered with a different identity
The machine at that address isn’t the one Shortcutify first connected to. If you rebuilt or replaced it, tap Forget Server Identity, then Save and Test. Otherwise, don’t connect.
All SSH actions #
These are the actions available in the app’s request picker. Open one for its inputs, returned fields, and permissions.
Service setup references #
The service controls its account requirements and permissions. These references explain its setup in more detail.