The following code runs 5 ssh in parallel.
I need a terminal because sudo(8) wants one (using -S doesn't help). Note that I use a key pair to connect, so no password is asked.
However, the output is the following:#!/usr/bin/perl use strict; use warnings; my $i; for ($i = 0; $i < 5; $i++) { my $pid = fork; if ($pid) { next } exec 'ssh -t 127.0.0.1 "sudo echo hello"'; exit 0; } for (; $i > 0; $i--) { wait }
hello
Connection to 127.0.0.1 closed.
hello
Connection to 127.0.0.1 closed.
hello
Connection to 127.0.0.1 closed.
hello
Connection to 127.0.0.1 closed.
hello
Connection to 127.0.0.1 closed.
And afterward, echo is disabled on the TTY and I need to use "reset".
Do you have any idea about I could solve this, please?
Thank you very much.
Best regards,
In reply to TTY screwed when running multiple ssh by jlhsgcib
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |