|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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'); |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Net::SSH::Perl won't perform agent authentication |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|