Re: Where does the "prompt come from"

From: Per Hedeland (per_at_hedeland.org)
Date: 03/26/04


Date: Thu, 25 Mar 2004 23:14:36 +0000 (UTC)

In article <c3s3b1$nf$1@newstree.wise.edt.ericsson.se> "Niclas Bäckman"
<niclas.c.backman@ericsson.com> writes:
>
>The reason I ask is that we have developed a product that redirects
>stdin/stdout/stderr from the ssh binary to a socket, and we then
>perform socket read/writes directly into the ssh tunnel. But when i perform
>a command, the prompt is never read up from the server.

Since the shell doesn't get a tty (due to ssh's stdin/stdout/stderr
being a socket), it runs in non-interactive mode => no prompt. You can
either give it a tty by using -t twice on the ssh command (I assume
OpenSSH here), i.e. 'ssh -t -t user@host', or you can tell the shell to
be interactive anyway, normally -i is used for this. In the latter case
you need to give the shell as the 'remote command' to ssh (otherwise
there's nowhere to pass the '-i'), e.g. 'ssh user@host sh -i'.

--Per Hedeland
per@hedeland.org