Re: Scripting SSH connections

From: Greg Wooledge (wooledg_at_eeg.ccf.org)
Date: 05/17/04

  • Next message: Piszcz, Justin Michael: "RE: Scripting SSH connections"
    Date: Mon, 17 May 2004 09:06:54 -0400
    To: Simon Burson <Simon.Burson@telecom.co.nz>
    
    

    On Mon, May 17, 2004 at 11:58:59AM +1200, Simon Burson wrote:
    > 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.

    Set up RSA or DSA authentication keys, and then there's no problem at
    all.

    imadev:~$ cp .ssh/id_rsa.pub .ssh/authorized_keys
    imadev:~$ ssh vandev ps -fu wooledg | sed 1d
     wooledg 3825 3823 0 09:05:23 ? 0:00 sshd: wooledg@notty
     wooledg 3826 3825 5 09:05:23 ? 0:00 ps -fu wooledg

    That sort of thing. The "log off gracefully" part is a no-op. The ssh
    command's output goes to stdout, so you can pipe it (as shown above),
    save it in a variable, save it to a file, or whatever you need to do.


  • Next message: Piszcz, Justin Michael: "RE: Scripting SSH connections"

    Relevant Pages

    • RE: ssh authentication with RSA SECURID
      ... I used to work for RSA and am now an independent consultant with some 10 ... SecurID integrations with SSH for US based customers. ... SFTP, without any authentication! ... Integrate the ACE/Agent APIs directly with the SSH source code. ...
      (SSH)
    • Re: Security/Hacked System - Now what?!!
      ... to be able to ssh into the box without having to use the ssh passwd, ... You should set up the RSA or ECDHE private keys with a password. ... all forms of unix password logins turned off. ... ClientAliveCountMax 30 ...
      (Fedora)
    • Re: SSH on PIX firewall
      ... Configuring PIX to Accept SSH Connections ... Our first task is to generate an RSA public/private key pair to use to ... Specify what hosts are allowed to SSH to the PIX and set the SSH ... Set the enable password and Telnet password. ...
      (comp.security.firewalls)
    • OpenSSH_3.0.2p1 root cannot login with password
      ... Root can only ssh in with RSA, ... It almost seems as if it's thinking that "Password Authentication" is ... files or program output, but since I bet I'm just missing something, ...
      (comp.security.ssh)
    • Re: OT: Security....
      ... Don't use port 22. ... Disable password authentication and use RSA, ... If you only need SSH access from specific locations, ...
      (Fedora)