
ssh の設定を間違えたようです。
最近、ローカル リポジトリをクローンできなくなりました。Git リポジトリは公開キーとパスワードの両方を受け入れているようですが、2 つのオプションのいずれかを選択させる代わりに、間違った RSA キーを使用して接続しようとするため、次のメッセージが表示されます。
Received disconnect from myRemoteComputer : Too many authentication failures for myUsername
fatal: Could not read from remote repository.
そのコンピュータにSSH接続しても同じことが起こる
$ssh -v myRemoteComputerIP
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/myUsername/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: myUsername@cvg04
Received disconnect from myRemoteComputerIP: Too many authentication failures for myUsername
何かがおかしいようです。最近は両方のコマンドが機能していました。基本的には、間違った「RSA キー」をランダムに選択するのではなく、ユーザー名とパスワードを指定してssh
使用する必要がありますgit
。これを修復する方法を知っている人はいますか?
またssh-add
、最近、フォーラムのアドバイスに従っていくつかのコマンドを実行しましたが、それが問題の一部である可能性があります...
答え1
を確認してください~/.ssh/config
。パスワード認証を使用する場合は、次のように設定できます。
Host myRemoteComputerIP
PubkeyAuthentication no
このホストに対して公開鍵認証を試行することはありません。
1 度は RSA キーを使用し、もう 1 度はユーザー名 / パスワード認証を使用して、2 つの異なるユーザー名で接続する必要がある場合はどうでしょうか。
次の場所でエイリアスを使用できますssh_config
:
Host alias1
Hostname myRemoteComputerIP
PubkeyAuthentication no
User user1
Host alias2
Hostname myRemoteComputerIP
# PubkeyAuthentication yes # is default
User user2
次に、ssh alias1
およびを使用して接続しますssh alias2
。
答え2
https を使用してクローンを作成すると、常にパスワードが要求されます。例:
git clone https://github.com/my_company/myrepo.git