Bernie Cosell
2018-12-13 01:39:41 UTC
I don't know if this is a host problem, net_ssh2 problem or what. I have a
perfectly working script that does:
my $ssh2 = Net::SSH2->new() ;
$ssh2->connect(HOST) or $ssh2->die_with_error ;
$ssh2->check_hostkey(tofu => HOSTKEY)
or $ssh2->die_with_error ;
$ssh2->auth_publickey(USER, PUBLICKEY, PRIVATEKEY)
or $ssh2->die_with_error ;
$ssh2->auth_ok() ;
print "connected!\n" ;
When the *only* change I make is to change the HOST and the USER to a
different host [one I can SSH into with an SSH client using the same SSH
keys] I get
Username/PublicKey combination invalid (-18
LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
) at D:\Perl\ondreamhost.pl line 26.
And I'm a bit perplexed. Perhaps I just don't understand how ssh keys
work: Does the private key somehow encode the username? In my SSH client
I'm using the same SSH key profile for both hosts. Why would a
username/publickey combination be invalid?
Thanks /bernie\
perfectly working script that does:
my $ssh2 = Net::SSH2->new() ;
$ssh2->connect(HOST) or $ssh2->die_with_error ;
$ssh2->check_hostkey(tofu => HOSTKEY)
or $ssh2->die_with_error ;
$ssh2->auth_publickey(USER, PUBLICKEY, PRIVATEKEY)
or $ssh2->die_with_error ;
$ssh2->auth_ok() ;
print "connected!\n" ;
When the *only* change I make is to change the HOST and the USER to a
different host [one I can SSH into with an SSH client using the same SSH
keys] I get
Username/PublicKey combination invalid (-18
LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED
) at D:\Perl\ondreamhost.pl line 26.
And I'm a bit perplexed. Perhaps I just don't understand how ssh keys
work: Does the private key somehow encode the username? In my SSH client
I'm using the same SSH key profile for both hosts. Why would a
username/publickey combination be invalid?
Thanks /bernie\
--
Bernie Cosell Fantasy Farm Fibers
***@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
Bernie Cosell Fantasy Farm Fibers
***@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--