权限被拒绝(公钥、键盘交互)
当我尝试从 Perl 进行 cvs 签出时,权限被拒绝(公钥、键盘交互)出现此错误。
有什么问题以及如何解决这个问题?
代码:
system ( "CSVROOT:--- CVSRSH:--- cvs co a ");
# i have proper value in cvs root and cvs rsh .
它单独运行并使用 ssh 密钥
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
诊断错误的步骤:
cron
作业不在同一环境下运行)如果您认为所有答案都是肯定的,那么最后一个答案很可能实际上是否定的。如果脚本是从诸如 cron 之类的调度程序运行的,那么它很可能不会在与手动运行它时相同的环境中运行。我通常解决这个问题的方法是在调度程序和 Perl 脚本之间使用 shell 脚本:
Steps to diagnose the error:
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:Chas. 提出问题后的后续调查:
该命令通常在
/bin/sh
或其他 shell 下运行吗?要进行测试,请执行
/bin/sh
命令启动 Bourne shell 并再次手动尝试该命令。我不熟悉“CVSROOT:---”符号 - 这是否意味着设置 CVSROOT 环境变量?在 Bourne shell 中,通常使用“=”完成,从未见过使用“:”。
该命令在手动运行时是否需要您输入一些内容?我从未见过
cvs co
这样做,但我不将它与 ssh 一起使用。尝试在命令末尾添加重定向,并在运行后查看文件中的内容:
system ( "CSVROOT:--- CVSRSH:--- cvs co a > /tmp/log_cmd 2>&1");
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");