How to read from stdin with dbclient

Tobias Dussa (SCC) tobias.dussa at kit.edu
Thu Aug 30 18:39:50 WST 2012


Hi,

I'm trying to ship something to a script on a remote machine via SSH
and catch its output.

As an example, let's say that user foo on machine bar has "cat"
defined as her shell.  Thus, after connecting to bar as foo, anything
that is sent to bar is sent back.

Theoretically, piping something into the ssh command should result in
that something being thrown back.  This does indeed work as expected
when using openssh's ssh client, like this:
  echo baz | ssh -qi IDENTITY foo at bar

Trying the same with dbclient yields "Failed reading termmodes" for
this command:
  echo baz | dbclient -i DB_IDENTITY foo at bar

This points to the fact that no pty is available, which is correct, of
course, and can be prevented by using the -T switch, which tells
dbclient not to allocate a pty:
  echo baz | dbclient -T -i DB_IDENTITIY foo at bar

However, this is where things go wrong.  The "baz" string does still
indeed arrive at the remote server and is processed by foo's shell,
but is not printed by dbclient.  This is unfortunate as I really need
to capture the output.

So, the obvious question is, how can I get to the output?

THX & Cheers,
Toby.
-- 
E Pluribus Unix

----

Karlsruhe Institute of Technology (KIT)
Steinbuch Centre for Computing (SCC)
KIT-CERT

Tobias Dussa
CERT Manager, CA Manager

Zirkel 2
Building 20.21
76131 Karlsruhe, Germany

Phone: +49 721 608-42479
Fax: +49 721 608-9-42479
Email: tobias.dussa at kit.edu
Web: http://www.kit.edu/

KIT – University of the State of Baden-Wuerttemberg and
National Laboratory of the Helmholtz Association
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5500 bytes
Desc: not available
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20120830/5e713e26/attachment.bin 


More information about the Dropbear mailing list