Where does the "prompt come from"

Damien Miller djm at mindrot.org
Thu Mar 25 10:56:16 EST 2004


Niclas Bäckman C (LI/EAB) wrote:

> Hi All !
> I have a little question about the shell that is run when establishing a
> connection towards an SSH server.
> The client(OpenSSH) displays a prompt(as usual) when a command is executed,
> but my question is, where does the prompt come from.
> Is it sent by the remote shell or is it handled in the client ??
> 
> 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.
> So it's difficult to know when a remote script is finished. Using the same
> solution but towards a telnet server always results in a prompt
> back to the client.

The prompt comes from the shell that the server executes.

If you want to use OpenSSH as a transport, you should probably invent a
little protocol and implement it as a subsystem. sftp does this.

-d




More information about the openssh-unix-dev mailing list