--nextPart20705403.RR8G1QUx32
Content-Type: text/plain;
  charsetso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Thursday 07 September 2006 22:29, Joel VanderWerf wrote:
> Pau Garcia i Quiles wrote:
> > Why won't you use Net::SFTP instead of calling the external scp?
>
> I can guess one reason. Net::SFTP doesn't work with key-based
> authentication, only passwords, and there is no password given in OP's
> code....
>
> I hope that I am wrong and that this has changed recently.

Actually, it works with key-based authentication:

require 'net/ssh'
require 'net/sftp'

Net::SSH.start( '192.168.1.37',
                :username=>'pgquiles'
              ) do |session|

        session.sftp.connect do |sftp|
                sftp.put_file("backup.tar.bz2", "/media/hda3/backup.tar.bz2")
        end
end


-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to the amount of work, I usually need 10 days to answer)

--nextPart20705403.RR8G1QUx32
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBFBD9B/DzYv9iGJzsRAhn4AKDhH83N1AXZX7+sOH1VUR0j1aWSBQCfZFzT
VbaGczXKkzivOvZzYNbgB78uI
-----END PGP SIGNATURE-----

--nextPart20705403.RR8G1QUx32--