複数の GitHub アカウントに複数のキーを使用するために (このハウツーの後)、最初にローカル システムで default 以外の名前のキー ファイルを操作する必要がありますid_rsa
。
キーペアを作成し、秘密鍵部分を SSH 認証エージェントに追加し、公開鍵部分を GitHub に追加しました (「id_rsa_user
SSHキーの生成」)。id_rsa_user.pub
~/.ssh/config
次に、次の内容でファイルを作成しました。
#user account
Host github.com-user
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_user
最後に、プロジェクトのリモート URLgit@github.com:user/project.git
を(s.このハウツーgit@github.com-user:user/project.git
へのコメント) に変更しました。
現在、私の VirtualBox-VM (Debian) と TortoiseGit で動作しています。しかし、MSysGit はエラーをスローします。
(git@github.com:user/project.git をプッシュしようとしています)
***@**** /path/to/to/project (master)
$ git push
fatal: The remote end hung up unexpectedly
(git@github.com-user:user/project.git のクローンを作成しようとしています)
***@**** /path/to/to/project (master)
$ git clone git@github.com-user:user/project.git .
Cloning into '.'...
fatal: The remote end hung up unexpectedly
( git@github.com:user/project.git のクローンを作成しようとしています):
***@**** /path/to/to/project (master)
$ git clone git@github.com:user/project.git .
Cloning into '.'...
fatal: The remote end hung up unexpectedly
誰かがこの問題を解決する方法を知っていますか?
どうも
編集:
追加情報 --ssh -v git@github.com-user
出力:
***@**** ~/Desktop/test
$ ssh -v git@github.com-user
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Users/avex/.ssh/config
debug1: Applying options for github.com-user
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /c/Users/avex/.ssh/id_rsa_user type 1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze1+github8
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1+github8 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /c/Users/avex/.ssh/known_hosts:1
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 public key: /c/Users/avex/.ssh/id_rsa_user
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Remote: Forced command: gerve user 8d:25:62:90:20:4e:89:99:85:42:2c:d6:0a:03:66:dc
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command: gerve user 8d:25:62:90:20:4e:89:99:85:42:2c:d6:0a:03:66:dc
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi user! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Connection to github.com closed.
debug1: Transferred: stdin 0, stdout 0, stderr 34 bytes in 0.6 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 61.2
debug1: Exit status 1