使用SSH在bitbucket管道上出错

时间:2018-04-29 03:26:57

标签: git ftp bitbucket bitbucket-pipelines git-ftp

我有bitbucket生成的密钥,所以它们的格式应该是正确的。但是,当我尝试访问它时,它会说

SSH public key authentication failed: 
  Unable to extract public key from private key file: 
  Method unimplemented in libgcrypt backend'

输出:

git ftp push -vv -u $FTP_USERNAME --remote-root ******* sftp://*/

Sun Apr 29 02:33:53 UTC 2018: git-ftp version 1.3.1 running on Linux 7f8ad68e-00af-4619-86e1-873fbc4c464e 4.14.11-coreos #1 SMP Fri Jan 5 11:00:14 UTC 2018 x86_64 GNU/Linux

Sun Apr 29 02:33:53 UTC 2018: Host is ''.
Sun Apr 29 02:33:53 UTC 2018: User is '$FTP_USERNAME'.
Sun Apr 29 02:33:53 UTC 2018: No password is set.
Sun Apr 29 02:33:53 UTC 2018: Path is '**'.
Sun Apr 29 02:33:53 UTC 2018: Syncroot is ''.
Sun Apr 29 02:33:53 UTC 2018: The remote sha1 is saved in file '.git-ftp.log'.
Sun Apr 29 02:33:53 UTC 2018: CACert is ''.
Sun Apr 29 02:33:53 UTC 2018: Insecure is ''.
Sun Apr 29 02:33:53 UTC 2018: Retrieving last commit from sftp://$FTP_USERNAME:@
Trying 173.236.184.138...
 TCP_NODELAY set
 Connected to ************
 SSH MD5 fingerprint: 158b694980acd0dfcb1b188b2434b20a
 SSH authentication methods available: publickey,password
 Using SSH private key file ''
 SSH public key authentication failed: Unable to extract public key from private key file: Method unimplemented in libgcrypt backend
 Failure connecting to agent
 Authentication failure
Closing connection 0

1 个答案:

答案 0 :(得分:0)

该错误来自libssh2/libssh2/src/libgcrypt.c

cloudfoundry-incubator/bosh-workspace/issue 97报告:

  

在其他地方,libssh2 v 1.6.0无需投诉

显然,这取决于您的操作系统版本。

检查你的libssh2和ssh2版本,然后尝试编译/安装更新版本的libssh2

# yum install make gcc glibc-devel zlib-devel openssl-devel php-devel

Compile and install libssh2 libraries:

# wget https://libssh2.org/download/libssh2-1.8.0.tar.gz
# tar vxzf libssh2-1.8.0.tar.gz
# cd libssh2-1.8.0/
# ./configure
# make
# make install

ssh2

# wget https://pecl.php.net/get/ssh2-0.13.tgz
# tar vxzf ssh2-0.13.tgz
# cd ssh2-0.13
# phpize
# ./configure --with-ssh2
# make
# make install