tags:

views:

160

answers:

2

Permission denied (publickey,keyboard-interactive) got this error while i am trying to cvs checkout from perl.

what is issue and how to reslove this ?

Code :

system ( "CSVROOT:--- CVSRSH:--- cvs co a ");

# i have proper value in cvs root and cvs rsh .

its running alone and using ssh key

+1  A: 

Steps to diagnose the error:

  • Are you using an SSH key?
  • Does that key have a passphrase?
  • Does it work when you run it by hand?
  • Is the script running as the same user as when you run it by hand?
  • Is the script running under the same environment as when you run it by hand? (e.g. cron jobs do not run under the same environment)

If you think all of the answers are yes, then most likely the last answer is really no. If the script is running from a scheduler like cron it most likely does not run with the same environment as when you run it by hand. The way I normally solve this is to use a shell script between the scheduler and the Perl script:

#!/bin/bash

source /home/USERNAME/.profile

#set any other environment variables it needs like

export CSVROOT=:pserver:USERNAME@HOST:/path/to/repo
export CVSRSH=ssh

/path/to/perl/script/script.pl
Chas. Owens
all questions answer is YES
Tree
+1  A: 

Follow-up investigations after Chas.'s questions:

  • Does that command normally run under /bin/sh or some other shell? To test, execute /bin/sh command to start Bourne shell and try the command by hand again. I'm not familiar with "CVSROOT:---" notation - is that meant to set CVSROOT environmental variable? In Bourne shell it's usually done using "=", never saw ":" used.

  • Does the command, when run by hand, expect some input from you? I never saw cvs co to do so, but I don't use it with ssh.

  • Try to add a redirect to the end of the command and look what's in the file after running:

    system ( "CSVROOT:--- CVSRSH:--- cvs co a > /tmp/log_cmd 2>&1");

DVK