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: Execute and lock a user into a program upon login
    ... logs in to the box via SSH, a command is run, and they immediately get ... dropped into the environment that the command produces. ... user is dropped into the application 'vtysh' ... shell drops (ie. user does not have to exit the csh shell to drop the ...
    (freebsd-questions)
  • Re: Execute and lock a user into a program upon login
    ... logs in to the box via SSH, a command is run, and they immediately get ... dropped into the environment that the command produces. ... user is dropped into the application 'vtysh' ... shell drops (ie. user does not have to exit the csh shell to drop the ...
    (freebsd-questions)
  • Re: tcsh is better for interactive use (Was: Bash command via ssh)
    ... In 1994 I was working on plenty of systems that didn't have bash or tcsh. ... The problem is that you need two useful ways of invoking a command ... Though that would be somewhat of a hack, ssh could simply make this distinction ... shell code, two or more arguments are strings to be passed to execv. ...
    (comp.unix.shell)
  • 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: remote invocation for any user
    ... to enusre that ssh works without a password. ...  Are you sure you don't want to enclose the command ... trusted SSH key to another server, where your code looks like it'll ... I did invoke DCC.pl from the shell that hangs too. ...
    (comp.lang.perl.misc)