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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |