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

interactive shell with ssh


I have to admin several remote machines.  Usually I just do a
 xterm -e ssh some.other.host
which works just great.

But now I want to setup a mechanism that executes commands on _all_ remote
machines, e.g "apt-get update; apt-get upgrade".  So I wrote a script that
loops through the list of hosts and calls:

 xterm -e ssh -l root $somehost "apt-get update; apt-get upgrade; echo 'Press ENTER to close'; read"

First this seemed to work great, but then I noticed that "apt-get upgrade"
failed sometimes because that PATH was set wrong so that it couldn't find
ldconfig for example.  I noticed that ssh sets some default path and zsh
doesn't modify that because it's not an interactive shell.  Doh.

After I found a solution to that (using zshenv) I next noticed that
"dialog" (which is used by the Debian install scripts to ask configuration
questions) doesn't work either because TERM is not set and because zsh
thinks there is no tty.  Now I'm stuck.  :-(

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???

Thanks a lot for any pointer,

           http://peru.spiegl.de  Our project
      http://radiomaranon.org.pe  Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 Computers in the future may weigh no more than 1.5 tons.
  - Popular Mechanics, 1949

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