Hello,

I am trying to use Net::SSH::Perl to send a few commands to a remote
server and I already have the ssh public keys setup as a normal ssh
user@remotehost command works.

Here is a snip from my code:

[snip]
my @ids = ("/path/to/.ssh/id_rsa.pub");


my %params = (
identity_files => \@ids,
debug => 1,
options => ["StrictHostKeyChecking no"],
);


my $ssh = Net::SSH::Perl->new($server, %params);


if ($debug) {
verboseLog("sshCmd(), server = $server: command = $command");
}


# login with $ssh_user
$ssh->login($ssh_user);

[/snip]

When I run the script I get this:
> dev: Waiting for server public key.
> dev: Received server public key (768 bits) and host key (1024 bits).
> dev: Host '67.126.xxx.xxx' is known and matches the host key.
> dev: Encryption type: DES3
> dev: Sent encrypted session key.
> dev: Received encryption confirmation.
> dev: RSA authentication failed: Can't load public key.
> dev: RSA authentication failed: Can't load public key.
> dev: Doing challenge response authentication.
> Password:
As you can see it's not able to load the public key, although the path
is correct and it exists.

I performed a strace and got the following, but it's out of my knowledge
base of understanding below the open()

Any thoughts?

[snip]
From the readkey area of the output:

24548
open("/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Term/ReadKey/ReadKey.so",
O_RDONLY) = 5
24548 read(5,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\3 20\32"..., 512) = 512
24548 fstat64(5, {st_mode=S_IFREG|0555, st_size=121252, ...}) = 0
24548 old_mmap(NULL, 38200, PROT_READ|PROT_EXEC, MAP_PRIVATE, 5, 0) =
0x40612000
24548 old_mmap(0x4061b000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 5, 0x8000) = 0x4061b000
24548 close(5) = 0
24548 brk(0) = 0x85a0000
24548 brk(0x85a1000) = 0x85a1000
24548 brk(0) = 0x85a1000
24548 brk(0x85a2000) = 0x85a2000
24548 brk(0) = 0x85a2000
24548 brk(0x85a3000) = 0x85a3000
24548 ioctl(0, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
24548 ioctl(0, SNDCTL_TMR_START, {B38400 opost isig icanon -echo ...}) = 0
24548 ioctl(0, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon -echo
....}) = 0
24548 brk(0) = 0x85a3000
24548 brk(0x85a4000) = 0x85a4000
24548 write(1, "Password: ", 10) = 10
[/snip]

--
#-------------------------------------------------------
# Robby Russell, | Sr. Administrator / Lead Programmer
# Command Prompt, Inc. | [url]http://www.commandprompt.com[/url]
# [email]rrussell@commandprompt.com[/email] | Telephone: (503) 667.4564
#-------------------------------------------------------