# Push to remote having two-factor authentication enabled

**URL:** <https://forum.gitea.com/t/push-to-remote-having-two-factor-authentication-enabled/9276>\
**Category:** Gitea Usages\
**Created:** [June 7, 2024, 3:56pm UTC](https://forum.gitea.com/t/push-to-remote-having-two-factor-authentication-enabled/9276 "2024-06-07T15:56:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat0donald](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/pat0donald/32/6006_2.png) [@pat0donald](https://forum.gitea.com/u/pat0donald)\
**Post date:** [June 7, 2024, 3:56pm UTC](https://forum.gitea.com/t/push-to-remote-having-two-factor-authentication-enabled/9276/1 "2024-06-07T15:56:16Z")

</div>

Hello, new _gitea_ user here, with limited git experience. I want to push to my [remote repository](https://gitea.com/omendezmorales/hello_rust.gitea.git), however the authentication fails with the following message:  
fatal: Authentication failed for [repo\_name]  
I suspect it has to do with the fact I have the two factor-authentication enabled (which I’m not asked for when I push),  
is there a way I can fix this?  
Any pointers/help, will be appreciated.  
Thanks,

---

<div class="post-metadata">

**Author:** ![truh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/truh/32/6007_2.png) [@truh](https://forum.gitea.com/u/truh)\
**Post date:** [June 7, 2024, 4:25pm UTC](https://forum.gitea.com/t/push-to-remote-having-two-factor-authentication-enabled/9276/2 "2024-06-07T16:25:56Z")

</div>

If you use SSH keys you shouldn’t have this problem.

Generate and add SSH keys

> **[How To Add & Verify SSH Keys Inside Gitea - Tech Addressed](https://www.techaddressed.com/tutorials/add-verify-ssh-keys-gitea/)**
>
> This short tutorial shows you how to add and verify SSH keys to a Gitea server. Configuring your Gitea account with a SSH key provides a level of security to your interactions with the server. These instructions should work regardless of how you've...

Then make sure to clone your repo with the ssh url or change your local repos remote url to the ssh url.

---

<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:** [June 13, 2025, 7:57pm UTC](https://forum.gitea.com/t/push-to-remote-having-two-factor-authentication-enabled/9276/3 "2025-06-13T19:57:28Z")

</div>


