# Remote: Gitea: Internal Server Connection Error 401 Unauthorized

**URL:** <https://forum.gitea.com/t/remote-gitea-internal-server-connection-error-401-unauthorized/8257>\
**Category:** Gitea Usages\
**Created:** [December 8, 2023, 2:26pm UTC](https://forum.gitea.com/t/remote-gitea-internal-server-connection-error-401-unauthorized/8257 "2023-12-08T14:26:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![facat](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@facat](https://forum.gitea.com/u/facat)\
**Post date:** [December 8, 2023, 2:26pm UTC](https://forum.gitea.com/t/remote-gitea-internal-server-connection-error-401-unauthorized/8257/1 "2023-12-08T14:26:05Z")

</div>

My gitea version 1.20.6  
My server system: arch linux

I create a new repository, clone it to local folder. Make some modification.  
When I push the local repository to the remote. I got:

> POST git-receive-pack (398 bytes)  
> remote:  
> remote: Gitea: Internal Server Connection Error  
> Pushing to [https://abc.xyz/abc/abc.git](https://abc.xyz/abc/abc.git)  
> Tohttps://abc.xyz/abc/abc.git  
> ! [remote rejected] main → main (pre-receive hook declined)  
> error: failed to push some refs to ‘[https://abc.xyz/abc/abc.git](https://abc.xyz/abc/abc.git)’

The gitea log prints this error

> /abc/abc.git/info/refs?service=git-receive-pack for xxx.xxx.xxx.xxx:0, 401 Unauthorized in 7.2ms @ repo/githttp.go:532(repo.GetInfoRefs)

My real IP is replaced with xxx.

Now I cannot push the local repository to the remote. Can someone please tell me hwo to fix it?

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [December 10, 2023, 6:05pm UTC](https://forum.gitea.com/t/remote-gitea-internal-server-connection-error-401-unauthorized/8257/2 "2023-12-10T18:05:18Z")

</div>

Have you changed/removed `INTERNAL_TOKEN` in app.ini? This symptom happens when running Gitea server and app.ini no longer have the same `INTERNAL_TOKEN`.

So when user connects over SSH, SSH server creates new Gitea process which reads app.ini for `INTERNAL_TOKEN` and tries to talk to running Gitea server with that token, but the tokens do not match so fail.
