# SSH authentication failures \[solved\]

**URL:** <https://forum.gitea.com/t/ssh-authentication-failures-solved/9656>\
**Category:** General\
**Created:** [August 30, 2024, 4:02pm UTC](https://forum.gitea.com/t/ssh-authentication-failures-solved/9656 "2024-08-30T16:02:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlauscheBytes](https://avatars.discourse-cdn.com/v4/letter/f/b782af/32.png) [@FlauscheBytes](https://forum.gitea.com/u/FlauscheBytes)\
**Post date:** [August 30, 2024, 4:02pm UTC](https://forum.gitea.com/t/ssh-authentication-failures-solved/9656/1 "2024-08-30T16:02:43Z")

</div>

Hi there,  
i’d like to share my experience with ssh authentication failures.

To be specific. I had this error. not always, but pretty persistent.

```auto
Received disconnect from xxx.xxx.xxx.xxx port xxx:2: too many authentication failures
Disconnected from xxx.xxx.xxx.xxx port xxx
fatal: Could not read from remote repository.

```

The error occurred on a newly installed development pc.  
I mirgrated the ssh keys from another device, where everything is working just fine.

All my other ssh connection where working just fine. But gittea gave this error.  
I created a new ssh keypair and it worked. At least for a while.

After searching the internet for a while i stumbled across [`IdentitiesOnly`](https://linux.die.net/man/5/ssh_config) ssh setting.

Enabling this revealed the acctual problem.

```auto
ssh mydomain
no such identity: /home/xxx/id_xxxx: No such file or directory
git@mydomain: Permission denied (publickey).

```

ssh was not using my defined Entity “IdentiyFile” at all. it was trying every key in the ssh keychange.  
Obviously I made a mistake changing the paths.

Hours of searching for a fix. It was ME forgetting the .ssh part in my local ssh config.

just wanted to share a possible solution for this.

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [August 31, 2024, 3:34am UTC](https://forum.gitea.com/t/ssh-authentication-failures-solved/9656/2 "2024-08-31T03:34:25Z")

</div>

Closed on August 31, 2024, 3:34am UTC


