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



Relevant Pages

  • Re: using ssh to run remote commands? [ssh -T, scp/ssh flags]
    ... I use SSH to forward connections between an intranet server at home and my ... To do this, the user on the remote machine need not have a shell, either ... start a shell on the remote host, ... you can have ssh run a command instead of an interactive shell by ...
    (FreeBSD-Security)
  • Re: Really need help on this one
    ... Is there a way to read the output of a particular command into ... Heres a better example using ssh. ... set timeout $timeout ... exec kill -9 $pid ...
    (comp.lang.tcl)
  • RE: midnight commander and ssh sftp
    ... midnight commander and ssh sftp ... which is displayed at the bottom of the MC panel. ... "Left file command options right" at the top of the MC ... MC SSH session with the remote host by hitting F10 key. ...
    (freebsd-questions)
  • Re: [Info-ingres] problems with ssh
    ... Check the SSHD log on the server for errors. ... ancient version of SSH, unfortunately. ... the command seems to have functioned - but just wont terminate and leaves a process hanging around. ... Duckman: You got anymore of those glues? ...
    (comp.databases.ingres)
  • Scripts using SSH and SSH_ASKPASS
    ... To test SSH scripts you better destroy the control TTY. ... The trick is to run YOUR script on YOUR local ... As for the password relaying command: this needs not be an X command. ... # we read one line from a temporary pipe. ...
    (comp.security.ssh)