Tasker + ZestSSH Automation Guide
This guide walks you through setting up Tasker to automate SSH operations with ZestSSH on Android. By the end, you will have working automation that triggers SSH commands based on events on your device.
Prerequisites
Section titled “Prerequisites”- ZestSSH (Pro) installed on your Android device.
- Tasker installed.
- At least one saved connection in ZestSSH.
- An API key created in ZestSSH.
Step 1: Create an API Key
Section titled “Step 1: Create an API Key”- In ZestSSH, go to Settings > Automation > API Keys.
- Tap Create New Key.
- Label it “Tasker” and set an expiration date.
- Copy the key and save it securely.
Step 2: Create a Basic Tasker Task
Section titled “Step 2: Create a Basic Tasker Task”Example: Run a Command on Your Server
Section titled “Example: Run a Command on Your Server”- Open Tasker and go to the Tasks tab.
- Tap + to create a new task. Name it “Server Uptime Check”.
- Tap + to add an action.
- Search for ZestSSH in the plugin list and select it.
- Configure the action:
- Connection: Select your server.
- Command:
uptime - API Key: Paste your API key.
- Tap the back button to save.
- Test the task by tapping the Play button.
Step 3: Create an Automation Profile
Section titled “Step 3: Create an Automation Profile”Example: Morning Server Check
Section titled “Example: Morning Server Check”Run a health check every day at 8 AM:
- Go to the Profiles tab.
- Tap + > Time.
- Set From to 08:00 and To to 08:00.
- Select your “Server Uptime Check” task.
- The profile is now active and will trigger daily.
Example: Wi-Fi-Based Connection
Section titled “Example: Wi-Fi-Based Connection”Connect to your home server when you join your home Wi-Fi:
- Tap + > State > Net > Wifi Connected.
- Enter your home Wi-Fi SSID.
- Link it to a task that connects to your home server and runs a status check.
Example: Low Battery Alert
Section titled “Example: Low Battery Alert”Send a shutdown command when your phone battery is critically low:
- Tap + > State > Power > Battery Level.
- Set the range to 0-5%.
- Create a task that SSHs into your server and runs a graceful shutdown or alert command.
Step 4: Advanced Automation
Section titled “Step 4: Advanced Automation”Chaining Multiple Commands
Section titled “Chaining Multiple Commands”Create a task with multiple ZestSSH actions to run a sequence of commands:
- Action 1: Connect and run
sudo apt update - Action 2: Run
sudo apt upgrade -y - Action 3: Run
sudo reboot
Using Tasker Variables
Section titled “Using Tasker Variables”You can pass Tasker variables into ZestSSH commands:
%DATE— current date%TIME— current time%WIFII— current Wi-Fi info- Custom variables from other Tasker actions
- Test each task manually before attaching it to a profile.
- Use Tasker’s notification actions to confirm when SSH tasks complete.
- Set reasonable API key expiration dates and rotate keys periodically.
- Be careful with destructive commands (shutdown, reboot) in automated profiles — add confirmation steps if needed.