I guess I messed with my ssh configuration.
Lately I cannot clone a local repository anymore. It seems like the git repository is accepting both publickey and password but instead of letting me choose one of the two options it tries to connect using some wrong RSA-key resulting in the message:
Received disconnect from myRemoteComputer : Too many authentication failures for myUsername
fatal: Could not read from remote repository.
Same happens when I ssh to that computer
$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
So something is going wrong, since lately both commands were working. I would basically need to tell ssh
and git
to use username and password instead of randomly choosing a wrong "RSA-key". Does anyone know how to repair this?
Also I executed some ssh-add
command lately following some forum advice but maybe it's part of the problem...
Check your
~/.ssh/config
. If you want to use password authentication, you can set it up just there like this:It will never try public key authentication against this host.
You can use aliases in the
ssh_config
:and then connect using
ssh alias1
andssh alias2
.Clone using https and it will always ask for password.
Eg - git clone https://github.com/my_company/myrepo.git