Re: [Ssh-sftp-perl-users] help needed for SFTP,SCP keys
Brought to you by:
dbrobins
From: Heiko J. <ja...@hb...> - 2008-07-10 06:57:03
|
Am Mittwoch, den 09.07.2008, 21:58 -0700 schrieb Vikas Poonia: [...] > if ( $ssh2->auth_publickey( $user, > '/opt/mqm/home/kls_dev/.ssh/id_rsa.pub', > '/opt/mqm/home/kls_dev/.ssh/id_rsa' ) ) > { > warn "Authentication succeeded\n" if $ssh2->auth_ok(); > } > else { > die "Authentication failed! $!"; > } > $ssh2->scp_get('/pkg/COBL/COBLxx72/users/kls_dev/vikas'); > exit 0; > > > bash-3.00$ ./vik-te.pl > Authentication failed! Invalid argument at ./vik-te.pl line 35. > Net::SSH2::DESTROY object 0x22a6d0 > > I dont khw why it is giving invalid argument. i have passed argument > as in the example. Can you please let me know some other way? a) Are you sure you really have the key files mentioned above? In your previous post you wrote: -- snip -- Where Public key= '/opt/mqm/home/kls_dev/vikas/id.pub' and Private key = '/opt/mqm/home/kls_dev/vikas/id' -- / snip -- Make sure the files you provide to the method really exist in the directory and with the name you mention. And of course it should be the same key pair from which you took the public key that you configured on the remote host. Also, please put in a line -- snip -- warn "libbsh2 Status:\n" . join( "\n", $ssh2->error() ); -- / snip -- before the line -- snip -- die "Authentication failed! $!"; -- / snip -- It provides the libssh2 error codes and messages. Heiko |