<small id='7isTR'></small><noframes id='7isTR'>

<tfoot id='7isTR'></tfoot>

      <bdo id='7isTR'></bdo><ul id='7isTR'></ul>

    1. <legend id='7isTR'><style id='7isTR'><dir id='7isTR'><q id='7isTR'></q></dir></style></legend>
    2. <i id='7isTR'><tr id='7isTR'><dt id='7isTR'><q id='7isTR'><span id='7isTR'><b id='7isTR'><form id='7isTR'><ins id='7isTR'></ins><ul id='7isTR'></ul><sub id='7isTR'></sub></form><legend id='7isTR'></legend><bdo id='7isTR'><pre id='7isTR'><center id='7isTR'></center></pre></bdo></b><th id='7isTR'></th></span></q></dt></tr></i><div id='7isTR'><tfoot id='7isTR'></tfoot><dl id='7isTR'><fieldset id='7isTR'></fieldset></dl></div>
      1. cURL sftp 公钥认证失败“回调错误"

        cURL sftp public key authentication fails quot;Callback Errorquot;(cURL sftp 公钥认证失败“回调错误)
            <bdo id='4m6q0'></bdo><ul id='4m6q0'></ul>

              <small id='4m6q0'></small><noframes id='4m6q0'>

                <tbody id='4m6q0'></tbody>

                  <legend id='4m6q0'><style id='4m6q0'><dir id='4m6q0'><q id='4m6q0'></q></dir></style></legend>
                  <tfoot id='4m6q0'></tfoot>
                  <i id='4m6q0'><tr id='4m6q0'><dt id='4m6q0'><q id='4m6q0'><span id='4m6q0'><b id='4m6q0'><form id='4m6q0'><ins id='4m6q0'></ins><ul id='4m6q0'></ul><sub id='4m6q0'></sub></form><legend id='4m6q0'></legend><bdo id='4m6q0'><pre id='4m6q0'><center id='4m6q0'></center></pre></bdo></b><th id='4m6q0'></th></span></q></dt></tr></i><div id='4m6q0'><tfoot id='4m6q0'></tfoot><dl id='4m6q0'><fieldset id='4m6q0'></fieldset></dl></div>
                  本文介绍了cURL sftp 公钥认证失败“回调错误"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一些 php 代码可以很好地使用 cURL 将文件上传到仅使用用户 & 的主机.密码 ftp,现在我必须上传到只允许公钥身份验证的服务器并收到错误:* SSH 公钥身份验证失败:回调返回错误"

                  I have some php code which works well uploading files using cURL to hosts which are simply using user & password ftp, now I have to upload to a server which only allows public key auth and am getting the error: "* SSH public key authentication failed: Callback returned error"

                  我的密钥有问题,因为它们的格式不正确,但后来将它们放入正确的单行格式,这阻止了非 base64 编码"错误.我在网上找不到太多关于这个回调错误的帮助.

                  I had a problem with the keys as they were not in the right format, but have since put them in the correct single line format and this stopped the "not base64 encoded" errors. I can't find much help on this callback error online.

                  我的代码如下.

                  $ch = curl_init();
                  curl_setopt($ch, CURLOPT_VERBOSE, TRUE); 
                  curl_setopt($ch, CURLOPT_URL, 'sftp://user:@12.12.12.12:22/testfile.gz');
                  curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
                  curl_setopt($ch, CURLOPT_SSH_PUBLIC_KEYFILE,'C:keyspublic.pub');
                  curl_setopt($ch, CURLOPT_SSH_PRIVATE_KEYFILE,'C:keysprivate.ppk');
                  curl_setopt($ch, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,'2acfe24108c37a276a93ac3398a5oe8f');
                  curl_setopt($ch, CURLOPT_SSH_AUTH_TYPES,CURLSSH_AUTH_PUBLICKEY);
                  curl_setopt($ch, CURLOPT_UPLOAD, 1);
                  $fp = fopen($localfile, 'r');
                  curl_setopt($ch, CURLOPT_INFILE, $fp);
                  curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile));
                  $sR = curl_exec ($ch);
                  

                  这是运行测试的输出

                  * About to connect() to 12.12.12.12 port 22 (#0)
                  *   Trying 12.12.12.12...
                  * connected
                  * Connected to 12.12.12.12 (12.12.12.12) port 22 (#0)
                  * SSH MD5 fingerprint: ebbc61b886c798b25073c912833ffers
                  * SSH authentication methods available: publickey
                  * Using ssh public key file C:keyspublic.pub
                  * Using ssh private key file C:keysprivate.ppk
                  * SSH public key authentication failed: Callback returned error
                  * Authentication failure
                  * Closing connection #0
                  

                  任何帮助表示赞赏

                  推荐答案

                  当你的 libssh2 是用 libgcrypt 构建时,有一些情况(基于 debian 的发行版).其中,使用 PEM 编码的私钥文件:

                  There are cases (debian-based distros) when your libssh2 is built with libgcrypt. In those, use PEM-encoded private key file:

                  $ openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
                  

                  这篇关于cURL sftp 公钥认证失败“回调错误"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    <tbody id='nuFDJ'></tbody>

                      <small id='nuFDJ'></small><noframes id='nuFDJ'>

                          • <bdo id='nuFDJ'></bdo><ul id='nuFDJ'></ul>
                          • <legend id='nuFDJ'><style id='nuFDJ'><dir id='nuFDJ'><q id='nuFDJ'></q></dir></style></legend>
                            <i id='nuFDJ'><tr id='nuFDJ'><dt id='nuFDJ'><q id='nuFDJ'><span id='nuFDJ'><b id='nuFDJ'><form id='nuFDJ'><ins id='nuFDJ'></ins><ul id='nuFDJ'></ul><sub id='nuFDJ'></sub></form><legend id='nuFDJ'></legend><bdo id='nuFDJ'><pre id='nuFDJ'><center id='nuFDJ'></center></pre></bdo></b><th id='nuFDJ'></th></span></q></dt></tr></i><div id='nuFDJ'><tfoot id='nuFDJ'></tfoot><dl id='nuFDJ'><fieldset id='nuFDJ'></fieldset></dl></div>
                          • <tfoot id='nuFDJ'></tfoot>