You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-3Lines changed: 31 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,10 @@
2
2
3
3
**sshsync** is a fast, minimal CLI tool to run shell commands across multiple remote servers via SSH. Easily target all servers or just a specific group, great for sysadmins, developers, and automation workflows.
4
4
5
-
> **IMPORTANT**: sshsync uses asyncssh for SSH connections. If you use passphrase-protected SSH keys, you MUST have your ssh-agent running with the keys added via ssh-add. sshsync will rely on SSH agent forwarding to authenticate with protected keys.
5
+
> **IMPORTANT**:
6
+
>
7
+
> 1. sshsync uses asyncssh for SSH connections. If you use passphrase-protected SSH keys, you MUST have your ssh-agent running with the keys added via ssh-add. sshsync will rely on SSH agent forwarding to authenticate with protected keys.
8
+
> 2. Throughout this documentation, whenever "host" is mentioned, it refers to the SSH alias defined by the `Host` directive in your `~/.ssh/config` file, not the actual hostname (`HostName` directive). sshsync uses these aliases for all operations.
6
9
7
10
## Features ✨
8
11
@@ -12,6 +15,7 @@
12
15
- 🕒 Adjustable SSH timeout settings
13
16
- 📁 **Push/pull files** between local and remote hosts
14
17
- 📊 Operation history and logging
18
+
- 🔍 **Dry-run mode** to preview actions before execution
15
19
16
20
## Installation 📦
17
21
@@ -64,12 +68,16 @@ sshsync all [OPTIONS] CMD
64
68
**Options:**
65
69
66
70
-`--timeout INTEGER` - Timeout in seconds for SSH command execution (default: 10)
71
+
-`--dry-run` - Show command and host info without executing
67
72
68
-
**Example:**
73
+
**Examples:**
69
74
70
75
```bash
71
76
# Check disk space on all servers with a 20 second timeout
72
77
sshsync all --timeout 20 "df -h"
78
+
79
+
# Preview which hosts would receive the command without executing
80
+
sshsync all --dry-run "systemctl restart nginx"
73
81
```
74
82
75
83
#### Execute on a Specific Group
@@ -81,12 +89,16 @@ sshsync group [OPTIONS] NAME CMD
81
89
**Options:**
82
90
83
91
-`--timeout INTEGER` - Timeout in seconds for SSH command execution (default: 10)
92
+
-`--dry-run` - Show command and host info without executing
84
93
85
-
**Example:**
94
+
**Examples:**
86
95
87
96
```bash
88
97
# Restart web services on production servers
89
98
sshsync group web-servers "sudo systemctl restart nginx"
99
+
100
+
# Preview the command execution on database servers without executing
101
+
sshsync group db-servers --dry-run "service postgresql restart"
> sshsync stores its configuration in a YAML file located at `~/.config/sshsync/config.yaml`. It uses your existing SSH configuration from `~/.ssh/config` for host connection details and stores only group information in its own config file. Before running other commands, it's recommended to run `sshsync sync` to assign hosts to groups for easier targeting.
235
+
>
236
+
> **Note about hosts**: sshsync uses the SSH alias (the `Host` directive) from your `~/.ssh/config` file, not the actual hostname. This means when you specify a host in any sshsync command, you're referring to the SSH alias that you've defined in your SSH config.
215
237
216
238
### Configuration File Structure
217
239
@@ -250,12 +272,18 @@ sshsync all "df -h"
250
272
# View memory usage on all database servers with increased timeout
251
273
sshsync group db-servers --timeout 30 "free -m"
252
274
275
+
# Preview a potentially destructive command without execution
0 commit comments