GIT似乎忽略了我的ssh配置文件

时间:2017-01-09 18:43:10

标签: git ssh proxy

我支持代理,所以我决定使用corkscrew和ssh配置文件连接到bitbucket。

我的~/.ssh/config文件:

Host bitbucket.org
  Hostname altssh.bitbucket.org
  User git
  IdentityFile ~/.ssh/id_rsa
  ProxyCommand /usr/bin/corkscrew <proxy_url> <proxy_port> %h %p
  Port 443

足够清楚,我定义了我的代理设置,并通过端口443上的https隧道连接我的ssh连接。

我在测试ssh -vT git@bitbucket.org时似乎工作正常 以下是显示成功连接的完整详细输出:

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/sierraromeo/.ssh/config
debug1: /home/sierraromeo/.ssh/config line 1: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Hostname has changed; re-reading configuration
debug1: Reading configuration data /home/sierraromeo/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Executing proxy command: exec /usr/bin/corkscrew <proxy_url> <proxy_port> altssh.bitbucket.org 443 ~/.ssh/auth
debug1: permanently_drop_suid: 1001
debug1: identity file /home/sierraromeo/.ssh/id_rsa type 1
debug1: identity file /home/sierraromeo/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version conker_1.0.268-723a194 app-132
debug1: no match: conker_1.0.268-723a194 app-132
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40
debug1: Host '[altssh.bitbucket.org]:443' is known and matches the RSA host key.
debug1: Found key in /home/sierraromeo/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/sierraromeo/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to altssh.bitbucket.org (via proxy).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = fr_FR.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
logged in as SierraRomeo.

You can use git or hg to connect to Bitbucket. Shell access is disabled.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 4048, received 1984 bytes, in 0.2 seconds
Bytes per second: sent 18748.6, received 9189.0
debug1: Exit status 0

但是当我只运行git pull(或任何其他git命令)时,似乎忽略了配置文件。

ssh: Could not resolve hostname bitbucket.org: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

我的project/.git/config文件已经过检查,看起来不错:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = git@bitbucket.org:path/to/project.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

我可能在这里遗漏了一些东西,却看不清楚。

为什么在执行ssh -T git@bitbucket.org时ssh连接并且在使用git <command>时失败?

任何帮助将不胜感激。

(我在Ubuntu 14.04 LTS上运行GIT 1.9.1)

0 个答案:

没有答案