Edmond Rodriguez on 8 Mar 2015 16:14:29 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] ssh's with -t , can one maintain individual streams?


Consider the following command series of ssh's.
There are no keys set up, all ssh's want passwords.

->  ssh A ssh B ssh C echo hello

This has the issue of getting passwords to ssh on machine B and ssh on
machine C.

Now one way to solve that might be to use -t

-> ssh -t A ssh -t B ssh -t C echo hello

That works, each ssh can ask for a password BUT...
all the streams now seem combined into one.  tty (I know that's not
really a stream, but the allocated tty's seem to now be STDIN and
STDOUT).  and STDOUT.
(maybe not STDERR, did not test that).

Lets say we want to cat a file and direct it to our local machine.

-> ssh -t A ssh -t B ssh -t C cat test.txt  > localTest.txt

This does not really work, since all kinds of other data is also
redirected out, like password prompts, , warning messages, etc.

Is it possible, without the use of keys, to get this series to work
and preserve what is stdout and stderr?  but still allow for some sort
of tty to get passwords to all the ssh's?

Thanks for any responses,

Edmond
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug