Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 12th, 2004, 01:34 PM
withak withak is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 withak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Net::SSH::Perl won't perform agent authentication

I'm working on a script to process files on a remote server. I can perform the funcitons fine if I enter the user/pass combo, but if I attempt authentication via the agent I get errors. In a shell I can ssh to the remote server with the desired user account and passwordless authentication works fine. Here's my attempted script and the debug response:

....................................
#!/usr/bin/perl -w
#
use strict;
use warnings;
use Net::SSH::Perl;

my $host = "host.com";
my $user = "myuser";
my $cmd = "pwd";

my $ssh = Net::SSH::Perl->new($host, debug => 1, identity_files => ["/home/username/.ssh/ssh_dsa_username"]);
$ssh->login($user);

my($stdout, $stderr, $exit) = $ssh->cmd($cmd);

print "$stdout";
print "$stderr";
print "$exit";
........................................

and here's what the server tells me.


.............................
[username@client perlwindows]$ ./firstssh.pl
client: Reading configuration data /home/username/.ssh/config
client: Reading configuration data /etc/ssh_config
client: Connecting to scadia.net, port 22.
client: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p2
client: Net::SSH::Perl Version 1.25, protocol version 1.5.
client: No compat match: OpenSSH_3.6.1p2.
client: Connection established.
client: Waiting for server public key.
client: Received server public key (768 bits) and host key (1024 bits).
Argument "ssh-rsa" isn't numeric in numeric eq (==) at /usr/lib/perl5/site_perl/5.8.3/Net/SSH/Perl/Key/RSA1.pm line 94, <FH> line 23.
client: Host 'host.com' is known and matches the host key.
client: Encryption type: DES3
client: Sent encrypted session key.
client: Received encryption confirmation.
client: RSA authentication using agent refused.
client: RSA authentication failed: Can't load public key
.
client: Doing challenge response authentication.
client: No challenge presented.
client: Trying password authentication.
client: Will not query passphrase in batch mode.
Permission denied at ./firstssh.pl line 26
[username@client perlwindows]$

...........................................................
As you can see the agent is refused and it can't load the public key. You can also see that I'm getting an ineq warning. The key I'm using was a DSA generated pair, because that is what is used around here.

Any help, useful comments, or ideas that might point me in the right direction are most welcome.

Thanks,
withaK

Reply With Quote
  #2  
Old October 12th, 2004, 03:17 PM
withak withak is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 withak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank anyway, fixed it by adding protocol=>'2,1' to the prams string, like this:

my $ssh = Net::SSH::Perl->new($host, debug => 1, identity_files => ["/home/username/.ssh/ssh_dsa_username"], protocol=>'2,1');

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Net::SSH::Perl won't perform agent authentication


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT