Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: interactive shell with ssh



On Aug 4,  1:11pm, Andy Spiegl wrote:
}
} Is there any way to execute commands on remote hosts allowing user
} interaction and everything - just as if I would first login with an
} interactive shell and then execute these commands???

To expand somewhat on Dan Nelson's answer:

You can execute _one_ command on a remote host that way with

  ssh -e none -t remoteuser@xxxxxxxxxxx "remotecommand ..."

If what you have is a whole series of commands to automate "as if" you
had typed them, you have the problem of needing to know exactly when a
user interaction will occur -- there aren't separate input streams for
commands vs. user input.

The closest you might get is to assemble a shell script file of the
commands to be executed, "scp" that to the remote host, then "ssh -t"
to the same host to run the script as the single remote command.  But
that introduces the need to be security conscious that the file you
execute is really the same one you scp'd.



Messages sorted by: Reverse Date, Date, Thread, Author