ssh无法连接到php中的git服务器

ssh无法连接到php中的git服务器,php,git,ssh,Php,Git,Ssh,我能够通过终端与远程git服务器进行连接和交互,但无法使用PHP进行连接和交互。我正在尝试执行以下命令: GIT_SSH_COMMAND="ssh -vvv -i ~/.ssh/id_rsa -F /dev/null" \ /usr/local/bin/git push -u origin master 如果我在终端中执行相同的命令,它就不会有问题。我在互联网上搜索了答案,但没有找到有效的解决方案 现在请记住,回购协议还不存在。我正试图通过这个命令创建它。我确实在几分钟前用这个确切的命令成功地

我能够通过终端与远程git服务器进行连接和交互,但无法使用PHP进行连接和交互。我正在尝试执行以下命令:

GIT_SSH_COMMAND="ssh -vvv -i ~/.ssh/id_rsa -F /dev/null" \
/usr/local/bin/git push -u origin master
如果我在终端中执行相同的命令,它就不会有问题。我在互联网上搜索了答案,但没有找到有效的解决方案

现在请记住,回购协议还不存在。我正试图通过这个命令创建它。我确实在几分钟前用这个确切的命令成功地创建了另一个repo。知道我错过了什么吗

这是调试输出

array:49 [▼
  0 => "OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011"
  1 => "debug1: Reading configuration data /dev/null"
  2 => "debug1: Connecting to git.modernizedmedia.com [208.53.61.173] port 22."
  3 => "debug1: Connection established."
  4 => "debug1: identity file /Users/greenorange/.ssh/id_rsa type 1"
  5 => "debug1: identity file /Users/greenorange/.ssh/id_rsa-cert type -1"
  6 => "debug1: Enabling compatibility mode for protocol 2.0"
  7 => "debug1: Local version string SSH-2.0-OpenSSH_6.2"
  8 => "debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1"
  9 => "debug1: match: OpenSSH_6.6.1 pat OpenSSH*"
  10 => "debug1: SSH2_MSG_KEXINIT sent"
  11 => "debug1: SSH2_MSG_KEXINIT received"
  12 => "debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none"
  13 => "debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none"
  14 => "debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent"
  15 => "debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP"
  16 => "debug1: SSH2_MSG_KEX_DH_GEX_INIT sent"
  17 => "debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY"
  18 => "debug1: Server host key: RSA ae:63:f0:7f:aa:62:5d:ac:ef:98:d6:66:a9:9c:4d:ce"
  19 => "debug1: Host 'git.modernizedmedia.com' is known and matches the RSA host key."
  20 => "debug1: Found key in /Users/greenorange/.ssh/known_hosts:64"
  21 => "debug1: ssh_rsa_verify: signature correct"
  22 => "debug1: SSH2_MSG_NEWKEYS sent"
  23 => "debug1: expecting SSH2_MSG_NEWKEYS"
  24 => "debug1: SSH2_MSG_NEWKEYS received"
  25 => "debug1: SSH2_MSG_SERVICE_REQUEST sent"
  26 => "debug1: SSH2_MSG_SERVICE_ACCEPT received"
  27 => "debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password"
  28 => "debug1: Next authentication method: publickey"
  29 => "debug1: Offering RSA public key: /Users/greenorange/.ssh/id_rsa"
  30 => "debug1: Server accepts key: pkalg ssh-rsa blen 535"
  31 => "debug1: key_parse_private_pem: PEM_read_PrivateKey failed"
  32 => "debug1: read PEM private key done: type <unknown>"
  33 => "debug1: read_passphrase: can't open /dev/tty: Device not configured"
  34 => "debug1: Next authentication method: password"
  35 => "debug1: read_passphrase: can't open /dev/tty: Device not configured"
  36 => "debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password"
  37 => "Permission denied, please try again."
  38 => "debug1: read_passphrase: can't open /dev/tty: Device not configured"
  39 => "debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password"
  40 => "Permission denied, please try again."
  41 => "debug1: read_passphrase: can't open /dev/tty: Device not configured"
  42 => "debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password"
  43 => "debug1: No more authentication methods to try."
  44 => "Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)."
  45 => "fatal: Could not read from remote repository."
  46 => ""
  47 => "Please make sure you have the correct access rights"
  48 => "and the repository exists."
]
数组:49[▼
0=>“OpenSSH_6.2p2,OSSLShim 0.9.8r 2011年12月8日”
1=>“debug1:正在读取配置数据/dev/null”
2=>“debug1:连接到git.modernizedmedia.com[208.53.61.173]端口22。”
3=>“调试1:已建立连接。”
4=>“debug1:identity file/Users/greenorange/.ssh/id\u rsa类型1”
5=>“debug1:identity file/Users/greenorange/.ssh/id_rsa-cert type-1”
6=>“调试1:启用协议2.0的兼容模式”
7=>“debug1:本地版本字符串SSH-2.0-OpenSSH_6.2”
8=>“调试1:远程协议版本2.0,远程软件版本OpenSSH_6.6.1”
9=>“debug1:match:OpenSSH_6.6.1 pat OpenSSH*”
10=>“debug1:SSH2\u MSG\u KEXINIT已发送”
11=>“debug1:SSH2\u MSG\u KEXINIT已接收”
12=>“debug1:kex:server->client aes128 ctr hmac-md5-etm@openssh.com“没有”
13=>“debug1:kex:client->server aes128 ctr hmac-md5-etm@openssh.com“没有”

14=>“debug1:SSH2\u MSG\u KEX\u DH\u GEX\u请求(1024此处确定了问题

读取\u密码短语:无法打开/dev/tty:未配置设备

您的私钥需要一个无法输入的密码短语,因为没有终端。由于ssh代理,在终端中运行命令时,您可能看不到这一点

一种解决方案是为远程服务创建一个新的密钥对,而不使用密码短语


此操作的安全含义是,无论何种具有新公钥的远程服务,现在只与私钥副本(即您的本地计算机帐户)一样安全。请随意评估此风险。

read\u passphrase:cannot open/dev/tty:Device not configured“
是的,这是正确的私钥。我如何纠正该错误,为什么在终端中运行命令时看不到它?您可能有一个ssh代理正在运行。请参阅。机器帐户私钥的一个解决方案是没有密码。这很有意义。关于如何纠正该问题,有什么建议吗?我需要吗使用一个没有附加密码短语的新rsa密钥?这绝对是一个解决方案