Live data from Hacker News

Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

github.com

1–10 of 77 posts

Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#1
I built a CLI tool called `sshsync` to run shell commands and transfer files across multiple servers over SSH concurrently.

It was inspired by tools like `pssh`, but I wanted something more modern, intuitive, and Pythonic.

What it does:

- Run shell commands on multiple servers (in parallel) - Push/pull files or directories with progress bars - Uses `~/.ssh/config` and lets you group hosts with YAML - Supports `--dry-run` mode to preview actions without executing - Outputs results using `rich` (tables, colors) - Built with `Typer`, `asyncssh`, and `rich`

There’s no daemon or extra setup, it reads your existing SSH config and just runs.

Would love feedback on general use and especially if there are ways to improve the `--dry-run` output.

Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers
github.com

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#4
How are commands handled, that require user input? E.g. password for sudo in your example:

  sshsync group web-servers "sudo systemctl restart nginx"
I like that you included a demo in the README, but it is too long for a gif, as I can't pause/rewind/forward. So splitting into multiple short gifs or converting into a video (if GitHub supports them) could improve the experience.

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#5
post #2

This looks great. I've used ansible in the past, is this tool like a stripped down (and thus simpler to use) version of ansible?

Given that ansible can be installed via "pip install ansible" I'm not sure how much simpler you can get?

Like a basic list of servers can also have this done via "ansible -m shell -a 'echo something' "

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#6
Around 10 years ago I was supporting infrastructure at a PHP shop and we needed a similar thing, but for ~3000 servers, and the library that we were using (libpssh) didn't support async SSH agent authentication, so I built this small tool in Go to allow to implement such tooling in any language (PHP, Python, whatever) in a simple way: https://github.com/YuriyNasretdinov/GoSSHa

It's main advantage is that it allows you to do SSH agent forwarding that actually works at scale, since it limits concurrency when talking to SSH agent to a configurable amount (by default 128, the default connection backlog in OpenSSH ssh-agent)

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#10
Have you looked at what powershell does? Invoke-Command (and the Job stuff it meshes perfectly with via AsJob) is really nice

I only needed a very small fraction of what it can do to bail a client out of a problem their customer caused on several hundred computers the night before an event, but it absolutely saved the day and a lot of money.

Post reply on HN