Scripting SSH connections

From: Simon Burson (Simon.Burson_at_telecom.co.nz)
Date: 05/17/04

  • Next message: M. Fioretti: "Re: ssh works through ppp0, not through ADSL router"
    Date: Mon, 17 May 2004 11:58:59 +1200
    To: secureshell@securityfocus.com
    
    

    I would like to write a basic shell script (Linux - bash) that will make
    an SSH connection to another machine, execute arbitrary commands, read
    back the output and log off gracefully. I can pipe commands to ssh but
    of course this isn't interactive and so decisions can't be made based on
    output.

    Does anyone know of a method/package where this can be done with ssh.
    Basically looking for a netcat type thing that supports SSH.

    Cheers.

    -Simon

    ------------------------------------------------------------------------------
    "This communication, including any attachments, is confidential.
    If you are not the intended recipient, you should not read
    it - please contact me immediately, destroy it, and do not
    copy or use any part of this communication or disclose
    anything about it. Thank you. Please note that this
    communication does not designate an information system for
     the purposes of the Electronic Transactions Act 2002."
    ------------------------------------------------------------------------------


  • Next message: M. Fioretti: "Re: ssh works through ppp0, not through ADSL router"

    Relevant Pages

    • Re: Scripting SSH connections
      ... > an SSH connection to another machine, execute arbitrary commands, read ... Set up RSA or DSA authentication keys, and then there's no problem at ...
      (SSH)
    • RE: Kind of off topic.
      ... If you "need" remote desktop access, perhaps WebEx would help - or as others pointed out an RDP client for *nix should work as well. ... To some I would be able to connect using ssh, ... >> OS's from FreeBSD? ... >The fastest and simplest method is still a plain good old SSH connection ...
      (freebsd-questions)
    • Re: reconnect expect to a rebooting remote
      ... If the appliance goes away the hard way and your ssh connection ... Either way you will get eof only when the network stack on the ... sshd is not running you will get connection refused. ...
      (comp.lang.tcl)
    • RE: Kind of off topic.
      ... To some I would be able to connect using ssh, ... OS's from FreeBSD? ... If the remote hosts are running FreeBSD, ... The fastest and simplest method is still a plain good old SSH connection ...
      (freebsd-questions)
    • Re: Rlogin doesnt work to on MDK 10.1 or FC3 systems
      ... GS>>> The rlogin server seems to be broken on Mandrake 10.1 (Community and ... I use ssh for all connections ... doors generally have the same configuration as your ... can use a *uniform* inter-machine communication mechanism. ...
      (comp.os.linux.misc)