[Anthill] SCP

Tim Colson tcolson at cisco.com
Tue Nov 23 16:01:12 CST 2004


I use SCP tasks, but instead of embedding the password, I'm using keys. 

This task and info below might be helpful to you, but if not, no guarantee
implied. <grin>

 <scp   
   file="${project.dist.dir}/${project.id}.war"
   toDir="userid at servername:${deploydir}"
   passphrase="" trust="true" 
   keyFile="C:/ssh/id_rsa"/>

Quick notes:

    * Login to servername
    * generate pub/private key pair using "ssh-keygen -t rsa"
          o PuTTY? folks point out a problem with DSA keys and highly
recommend RSA keys
          o do not add a passphrase, just hit enter
    * create/append {home}/.ssh/id_rsa.pub into authorized_keys2
    * copy id_rsa (the private key) to C:/ssh/ on the client computer
    * Add JSCH library to ANT_HOME/lib from http://www.jcraft.com/jsch/
    * run ant SCP/SSHEXEC tasks, using the priv key file

Putty notes:
    * The private key can also be 'converted' using puttygen into readble
putty key
    * Add the converted key into putty (Connection-SSH-Auth)
    * change the preferred SSH proto for the session to be "2"
    * move the Blowfish cipher to the top of the list
    * Login will prompt for userid, but no password
    * Create a shortcut to "C:\WINDOWS\putty.exe -l -load and no
userid/password req'd! Cool.

Resources: A page on creating the keyset -- using puttygen.exe on windows:
http://homepages.borland.com/ccalvert/linux/utils/sshDocs.html

UNIX - Setting up Passwordless UNIX Login
http://helpdesk.cs.tamu.edu/docs/unix_Passwordless_Login

SSH without passwords
http://nf.apac.edu.au/facilities/software/SSH/ssh-without-passwds.html 




More information about the Anthill mailing list