--Pk6IbRAofICFmK5e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 03, 2008 at 03:23:53AM +0900, Phlip wrote: > Shashank Agarwal wrote: > > >Is there a way to read a file over SSH? I looked at the net/ssh library > >but couldn't put together a working code. > > Here's a wild guess - does it help? > > require 'net/ssh' > require 'net/sftp' > > Net::SSH.start( 'myserver', 'myname', 'mypassword' ) do |session| > session.sftp.connect do |sftp| > sftp.get_file('path/filename', 'filename') > end > end I actually have need of some net/ssh help, too, though I don't need help with basic implementation. That part was easy, with the examples I've found. What I need is some way to securely store user names and passwords for later user in the Ruby SSH client, so that I don't have to hard-code the user name and password, store the actual user name and password in some file, or have the user enter them every single time he/she uses the application. Would you please point me at relevant documentation and/or examples, or provide some of your own for me if that's easier? I haven't looked at key-based authentication, but that's something else I'll be looking into as well. -- Chad Perrin [ content licensed PDL: http://pdl.apotheon.org ] Yasir Arafat on religious wars: "You're basically killing each other to see who's got the better imaginary friend." --Pk6IbRAofICFmK5e Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkiXFrMACgkQ9mn/Pj01uKXoNQCg5oiQAMWIeLwA7M7ULWJtCRna M0AAoN/EBcnZIk629DaZYzqRR9uHKxj4 A -----END PGP SIGNATURE----- --Pk6IbRAofICFmK5e--