Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #243532 > unrolled thread
| Started by | Marco Möller <talby@debianlists.mobilxpress.net> |
|---|---|
| First post | 2021-12-30 15:00 +0100 |
| Last post | 2021-12-30 21:30 +0100 |
| Articles | 12 — 6 participants |
Back to article view | Back to linux.debian.user
[OT] sending command to multiple SSH sessions, like in mRemoteNG Marco Möller <talby@debianlists.mobilxpress.net> - 2021-12-30 15:00 +0100
Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG Celejar <celejar@gmail.com> - 2021-12-30 15:20 +0100
[SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG Marco Möller <talby@debianlists.mobilxpress.net> - 2021-12-30 22:20 +0100
Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG Charles Curley <charlescurley@charlescurley.com> - 2021-12-30 15:40 +0100
[SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG Marco Möller <talby@debianlists.mobilxpress.net> - 2021-12-30 22:40 +0100
Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG Anssi Saari <as@sci.fi> - 2021-12-30 16:20 +0100
Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG Andy Smith <andy@strugglers.net> - 2021-12-30 16:50 +0100
Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG Nicholas Geovanis <nickgeovanis@gmail.com> - 2021-12-30 17:40 +0100
[SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG Marco Möller <talby@debianlists.mobilxpress.net> - 2021-12-30 22:40 +0100
Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG Marco Möller <talby@debianlists.mobilxpress.net> - 2021-12-30 18:00 +0100
Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG Andy Smith <andy@strugglers.net> - 2021-12-30 18:10 +0100
[SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG Marco Möller <talby@debianlists.mobilxpress.net> - 2021-12-30 21:30 +0100
| From | Marco Möller <talby@debianlists.mobilxpress.net> |
|---|---|
| Date | 2021-12-30 15:00 +0100 |
| Subject | [OT] sending command to multiple SSH sessions, like in mRemoteNG |
| Message-ID | <DA48h-5fq-1@gated-at.bofh.it> |
In search for a software recommendation: The remote session management app "mRemoteNG" for MS Windows comes with a functionality by which a command can be entered to its "Multi SSH" input field, and this command is then sent to all SSH connected remote systems at once as if the command would have been typed in at each single of the SSH connected remote systems CLI individually. Do you know about such feature to be implemented in some Linux tool? Maybe it even exists as a plugin for tmux? Best wishes, Marco.
[toc] | [next] | [standalone]
| From | Celejar <celejar@gmail.com> |
|---|---|
| Date | 2021-12-30 15:20 +0100 |
| Subject | Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG |
| Message-ID | <DA4rE-5Bj-1@gated-at.bofh.it> |
| In reply to | #243532 |
On Thu, 30 Dec 2021 14:54:40 +0100 Marco Möller <talby@debianlists.mobilxpress.net> wrote: > > In search for a software recommendation: > The remote session management app "mRemoteNG" for MS Windows comes with > a functionality by which a command can be entered to its "Multi SSH" > input field, and this command is then sent to all SSH connected remote > systems at once as if the command would have been typed in at each > single of the SSH connected remote systems CLI individually. > Do you know about such feature to be implemented in some Linux tool? > Maybe it even exists as a plugin for tmux? I'm not sure about tools that send commands to multiple hosts already connected over SSH, but there are some that are designed to execute the same command on multiple hosts by initiating SSH connections to them, such as pssh and clusterssh: https://code.google.com/archive/p/parallel-ssh/ https://linux.die.net/man/1/pssh https://github.com/duncs/clusterssh https://unix.stackexchange.com/questions/505159/how-to-run-the-same-command-on-multiple-servers https://www.tecmint.com/run-commands-on-multiple-linux-servers/ https://unix.stackexchange.com/questions/19008/automatically-run-commands-over-ssh-on-many-servers Celejar
[toc] | [prev] | [next] | [standalone]
| From | Marco Möller <talby@debianlists.mobilxpress.net> |
|---|---|
| Date | 2021-12-30 22:20 +0100 |
| Subject | [SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG |
| Message-ID | <DAb05-17J-7@gated-at.bofh.it> |
| In reply to | #243533 |
On 30.12.21 15:13, Celejar wrote: > On Thu, 30 Dec 2021 14:54:40 +0100 > Marco Möller <talby@debianlists.mobilxpress.net> wrote: > >> >> In search for a software recommendation: >> The remote session management app "mRemoteNG" for MS Windows comes with >> a functionality by which a command can be entered to its "Multi SSH" >> input field, and this command is then sent to all SSH connected remote >> systems at once as if the command would have been typed in at each >> single of the SSH connected remote systems CLI individually. >> Do you know about such feature to be implemented in some Linux tool? >> Maybe it even exists as a plugin for tmux? > > I'm not sure about tools that send commands to multiple hosts already > connected over SSH, but there are some that are designed to execute the > same command on multiple hosts by initiating SSH connections to them, > such as pssh and clusterssh: > > https://code.google.com/archive/p/parallel-ssh/ > https://linux.die.net/man/1/pssh > > https://github.com/duncs/clusterssh > > https://unix.stackexchange.com/questions/505159/how-to-run-the-same-command-on-multiple-servers > https://www.tecmint.com/run-commands-on-multiple-linux-servers/ > https://unix.stackexchange.com/questions/19008/automatically-run-commands-over-ssh-on-many-servers > > Celejar > Many great suggestions! It took me some time to follow all suggested links. Spontaneously it appears to me that clusterssh would best fit my special needs, and this tool would compete with the tmux functionality to synchronize panes when needed, as mentioned in one of the linked threads and then also suggested by Andy. I will test both options. Thanks a lot for your great help, and best wishes, Marco
[toc] | [prev] | [next] | [standalone]
| From | Charles Curley <charlescurley@charlescurley.com> |
|---|---|
| Date | 2021-12-30 15:40 +0100 |
| Subject | Re: [OT] sending command to multiple SSH sessions, like in mRemoteNG |
| Message-ID | <DA4L0-5HA-13@gated-at.bofh.it> |
| In reply to | #243532 |
On Thu, 30 Dec 2021 14:54:40 +0100 Marco Möller <talby@debianlists.mobilxpress.net> wrote: > Do you know about such feature to be implemented in some Linux tool? Take a look at mssh. -- Does anybody read signatures any more? https://charlescurley.com https://charlescurley.com/blog/
[toc] | [prev] | [next] | [standalone]
| From | Marco Möller <talby@debianlists.mobilxpress.net> |
|---|---|
| Date | 2021-12-30 22:40 +0100 |
| Subject | [SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG |
| Message-ID | <DAbjs-1e2-9@gated-at.bofh.it> |
| In reply to | #243535 |
On 30.12.21 15:06, Charles Curley wrote: > On Thu, 30 Dec 2021 14:54:40 +0100 > Marco Möller <talby@debianlists.mobilxpress.net> wrote: > >> Do you know about such feature to be implemented in some Linux tool? > > Take a look at mssh. > I will test it, although I spontaneously from reading do not expect it to be as comfortable as tmux with its synchronize panes functionality or clusterssh. However, a real test and figuring out how to properly make use this tool might surprise me! Thanks a lot, and best wishes, Marco
[toc] | [prev] | [next] | [standalone]
| From | Anssi Saari <as@sci.fi> |
|---|---|
| Date | 2021-12-30 16:20 +0100 |
| Message-ID | <DA5nH-69A-1@gated-at.bofh.it> |
| In reply to | #243532 |
Marco Möller <talby@debianlists.mobilxpress.net> writes: > The remote session management app "mRemoteNG" for MS Windows comes > with a functionality by which a command can be entered to its "Multi > SSH" input field, and this command is then sent to all SSH connected > remote systems at once as if the command would have been typed in at > each single of the SSH connected remote systems CLI individually. > Do you know about such feature to be implemented in some Linux tool? > Maybe it even exists as a plugin for tmux? I do simple stuff with just a for loop in the shell. For more complex stuff I use Ansible which uses ssh internally.
[toc] | [prev] | [next] | [standalone]
| From | Andy Smith <andy@strugglers.net> |
|---|---|
| Date | 2021-12-30 16:50 +0100 |
| Message-ID | <DA5QK-6jw-15@gated-at.bofh.it> |
| In reply to | #243536 |
Hello,
On Thu, Dec 30, 2021 at 05:15:18PM +0200, Anssi Saari wrote:
> Marco Möller <talby@debianlists.mobilxpress.net> writes:
> > this command is then sent to all SSH connected remote systems at
> > once as if the command would have been typed in at each single
> > of the SSH connected remote systems CLI individually. Do you
> > know about such feature to be implemented in some Linux tool?
>
> I do simple stuff with just a for loop in the shell. For more complex
> stuff I use Ansible which uses ssh internally.
Aside from shell loops, I've also in the past used dsh which is
still packaged in Debian:
http://www.netfort.gr.jp/~dancer/software/dsh.html
…but these days I also switched to using Ansible ad hoc commands and
playbooks for anything I do repeatedly. Well worth looking into.
Cheers,
Andy
[toc] | [prev] | [next] | [standalone]
| From | Nicholas Geovanis <nickgeovanis@gmail.com> |
|---|---|
| Date | 2021-12-30 17:40 +0100 |
| Message-ID | <DA6D8-6RN-1@gated-at.bofh.it> |
| In reply to | #243537 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Dec 30, 2021, 9:42 AM Andy Smith <andy@strugglers.net> wrote: > Hello, > > On Thu, Dec 30, 2021 at 05:15:18PM +0200, Anssi Saari wrote: > > Marco Möller <talby@debianlists.mobilxpress.net> writes: > > > this command is then sent to all SSH connected remote systems at > > > once as if the command would have been typed in at each single > > > of the SSH connected remote systems CLI individually. Do you > > > know about such feature to be implemented in some Linux tool? > > > > I do simple stuff with just a for loop in the shell. For more complex > > stuff I use Ansible which uses ssh internally. > > Aside from shell loops, I've also in the past used dsh which is > still packaged in Debian: > > http://www.netfort.gr.jp/~dancer/software/dsh.html Other similar options are pdksh, public domain Korn shell. Which is available in Debian repositories for some releases. And the dsh command on IBM's aix unix-ish OS :-) So with NIM support :-) looking like rsh. …but these days I also switched to using Ansible ad hoc commands and > playbooks for anything I do repeatedly. Well worth looking into. > The same can be said of the salt utility. Supported at cost by Saltstack if necessary. But IMO not the same use-case that the OP intended. One salt contributor some time ago was managing more than 10K servers with it, I only had a few hundred. > Cheers, > Andy > >
[toc] | [prev] | [next] | [standalone]
| From | Marco Möller <talby@debianlists.mobilxpress.net> |
|---|---|
| Date | 2021-12-30 22:40 +0100 |
| Subject | [SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG |
| Message-ID | <DAbjs-1e2-11@gated-at.bofh.it> |
| In reply to | #243539 |
On 30.12.21 17:38, Nicholas Geovanis wrote: > Aside from shell loops, I've also in the past used dsh which is > still packaged in Debian: > > http://www.netfort.gr.jp/~dancer/software/dsh.html > <http://www.netfort.gr.jp/~dancer/software/dsh.html> > > > Other similar options are pdksh, public domain Korn shell. Which is > available in Debian repositories for some releases. And the dsh command > on IBM's aix unix-ish OS :-) So with NIM support :-) looking like rsh. > > …but these days I also switched to using Ansible ad hoc commands and > playbooks for anything I do repeatedly. Well worth looking into. > > > The same can be said of the salt utility. Supported at cost by Saltstack > if necessary. But IMO not the same use-case that the OP intended. One > salt contributor some time ago was managing more than 10K servers with > it, I only had a few hundred. I'll keep these tools in mind for some possible future usage. Right now they seem to not exactly be what I was searching for, but obviously my initial question was lacking a proper description of my aspired usage scenario, especially the wish to keep sessions running interactively while also sending ad hoc commands simultanously to all these sessions. Your answer is much appreciated, thanks a lot for it, and best wishes! Marco
[toc] | [prev] | [next] | [standalone]
| From | Marco Möller <talby@debianlists.mobilxpress.net> |
|---|---|
| Date | 2021-12-30 18:00 +0100 |
| Message-ID | <DA6Wu-6Y4-5@gated-at.bofh.it> |
| In reply to | #243537 |
On 30.12.21 16:42, Andy Smith wrote: > On Thu, Dec 30, 2021 at 05:15:18PM +0200, Anssi Saari wrote: >> Marco Möller <talby@debianlists.mobilxpress.net> writes: >>> this command is then sent to all SSH connected remote systems at >>> once as if the command would have been typed in at each single >>> of the SSH connected remote systems CLI individually. Do you >>> know about such feature to be implemented in some Linux tool? >> >> I do simple stuff with just a for loop in the shell. For more complex >> stuff I use Ansible which uses ssh internally. > > Aside from shell loops, I've also in the past used dsh which is > still packaged in Debian: > > http://www.netfort.gr.jp/~dancer/software/dsh.html > > …but these days I also switched to using Ansible ad hoc commands and > playbooks for anything I do repeatedly. Well worth looking into. > I understand from your answer that with Ansible it will be possible to send commands to various destinations, and on its website (which I quickly have had a look at) it claims, that it is good for repeating several command long tasks. Right? As my aim is to interactively run the same commands on several machines, in order to observe if they everywhere behave the same or what different results they would produce, does each SSH session report back to Ansible the console output of the command, or allow interactivity with the session like answering questions at the console if the command would produce a question, as tmux allows such interactivity? Or is Ansible thought to send non-interactive commands which are supposed to not write output back to a visible console? Maybe I specify better what I want to do: for educational or for diagnostic purpose or for developing and testing a script, I would like to run a same command on various Linux systems, which have different configurations, and to then observe at the various consoles the result of it. So, the Ansible feature for handling repetitive tasks is for sure nice, but for me it is more of interest to write a command once and to observe its behavior multiple times, also after having sent the command once to all sessions to then interactivity follow up in each individual session where needed. To everybody thanks to all the interesting feedback already provided, also in the parallel to his sub-thread answers! Marco
[toc] | [prev] | [next] | [standalone]
| From | Andy Smith <andy@strugglers.net> |
|---|---|
| Date | 2021-12-30 18:10 +0100 |
| Message-ID | <DA769-7gz-9@gated-at.bofh.it> |
| In reply to | #243541 |
Hi Marco,
On Thu, Dec 30, 2021 at 05:49:38PM +0100, Marco Möller wrote:
> As my aim is to interactively run the same commands on several machines, in
> order to observe if they everywhere behave the same or what different
> results they would produce, does each SSH session report back to Ansible the
> console output of the command, or allow interactivity with the session like
> answering questions at the console if the command would produce a question,
> as tmux allows such interactivity? Or is Ansible thought to send
> non-interactive commands which are supposed to not write output back to a
> visible console?
While dsh or Ansible ad-hoc commands would report back the output,
Ansible won't work for / isn't designed for interactive use and it
would be quite awkward in dsh too. Wouldn't work for full terminal
applications and the like. So config management, ssh multilaunchers
and shell loops aren't the right topol for this.
If all you want to do is launch the same command everywhere, it's
pretty simple in tmux. Get all your logins in different panels and
then synchronize them so the same command is launched in all. Then
unsync to go through and interact individually again.
https://stackoverflow.com/questions/16325449/how-to-send-a-command-to-all-panes-in-tmux
Basically you are wanting a scriptable full terminal, so tmux fits
the bill I think. You can remote control it from outside in many
ways to get it to do what you want.
Cheers,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting
[toc] | [prev] | [next] | [standalone]
| From | Marco Möller <talby@debianlists.mobilxpress.net> |
|---|---|
| Date | 2021-12-30 21:30 +0100 |
| Subject | [SOLVED]: [OT] sending command to multiple SSH sessions, like in mRemoteNG |
| Message-ID | <DAadH-BV-3@gated-at.bofh.it> |
| In reply to | #243542 |
On 30.12.21 18:04, Andy Smith wrote: > Hi Marco, > > On Thu, Dec 30, 2021 at 05:49:38PM +0100, Marco Möller wrote: >> As my aim is to interactively run the same commands on several machines, in >> order to observe if they everywhere behave the same or what different >> results they would produce, does each SSH session report back to Ansible the >> console output of the command, or allow interactivity with the session like >> answering questions at the console if the command would produce a question, >> as tmux allows such interactivity? Or is Ansible thought to send >> non-interactive commands which are supposed to not write output back to a >> visible console? > > While dsh or Ansible ad-hoc commands would report back the output, > Ansible won't work for / isn't designed for interactive use and it > would be quite awkward in dsh too. Wouldn't work for full terminal > applications and the like. So config management, ssh multilaunchers > and shell loops aren't the right topol for this. > > If all you want to do is launch the same command everywhere, it's > pretty simple in tmux. Get all your logins in different panels and > then synchronize them so the same command is launched in all. Then > unsync to go through and interact individually again. > > https://stackoverflow.com/questions/16325449/how-to-send-a-command-to-all-panes-in-tmux > > Basically you are wanting a scriptable full terminal, so tmux fits > the bill I think. You can remote control it from outside in many > ways to get it to do what you want. > > Cheers, > Andy > I have had a first look to the suggested thread at stackoverflow and will try it out. It sounds very good, very promising, targeting my needs and I assume it to work well! Thanks a lot, and best wishes! Marco
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web