何をssh -vvv git@repo返しますか?
この ssh リクエストが機能しない限り、git@repoサーバーでの git 操作は機能しません。また、ssh が公開鍵を提供しようとしていると報告した場合は、それがレポ サーバー上
のファイルに正しく追加されていることを再確認する必要があります。~git/.ssh/authorized_keys
動作する ssh セッションの例の抜粋を次に示します。
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /p/.ssh/mypubkey
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp f8:d9:7...:cf
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
2 つのコメント:
- 私の
%HOME%参照では%HOMEDIR%なくカスタム ドライブ ( p:\)。
id_rsa.pub公開鍵/秘密鍵の名前がデフォルトの標準 ( / id_rsa)に従っていません
公開鍵ファイルに明示的に名前を付けるためにconfig、ディレクトリにファイルを追加しました。%HOME%\.ssh
host gitrepo
user git
hostname repo
identityfile ~/.ssh/mypubkey
そうすれば、次のように入力するだけssh gitrepoで、ssh はどのユーザー、ホスト名、および使用する公開鍵の正確なフル パスを認識します。