Thanks for your response, zentara . After a third time with a failed login using different methods that seem to work for everyone else, I double-checked my password, which hadn't been updated in my little world of perl development. (sorry about that: I'd roll my eyes if my mom did that) That solves one problem, but as I read, I come closer to the opinion that the preferred method for login is to use RSA key-pairs. So while I want to get some minimal functionality for getting content to my site, I'd also like to update this capability to reflect the methods of grown-ups using encryption.

In order to install Net::SSH2 I had to run the following commands on a debian system:

sudo apt-get install libssh2-1-dev sudo apt-get install zlib1g sudo apt-get install zlib1g-dev

http://www.perlmonks.org/?node_id=569657 was very helpful. Unfortunately, http://cfm.gs.washington.edu/security/ssh/client-pkauth/ gets a 404 from my browser. I looked at https://www.debian.org/devel/passwordlessssh as a source for how I might go forward.

As I look at what's in front of me, I have a machine capable of both SSH1 and SSH2. My ISP makes no distinction. Do I want to use one or the other? Does SSH2 comprehend SSH1? If I write for SSH2, will I have a wider range of application or more likely burdened by a level of encryption that hardly need exist for my little html pages that have nothing to do with banking, or national security and the like?

Anyways, here's caller and sub on the what works now.

#!/usr/bin/perl -w use strict; use 5.010; use lib "template_stuff"; use File::Basename; use Net::SSH2; use File::Spec; use Term::ReadKey; my $rftp = get_ftp_object(); say "object created, back in main";
sub get_ftp_object{ use strict; use Net::SSH2; use 5.01; my $sub_hash = "my_sftp"; my $domain = $config{$sub_hash}->{'domain'}; my $username = $config{$sub_hash}->{'username'}; my $password = $config{$sub_hash}->{'password'}; say "values are $domain $username $password"; #dial up the server my $ssh2 = Net::SSH2->new(); $ssh2->connect($domain) or die "Unable to connect Host $@ \n"; say "connect worked"; #this works for passwords $ssh2->auth_password($username,$password) or die "Unable to login $@ \ +n"; return $ssh2; }


In reply to Re^2: instantiating an SFTP object by Aldebaran
in thread instantiating an SFTP object by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.