Gitea: add SSH troubleshooting (regenerate keys, port 222)
25
Gitea.md
25
Gitea.md
@@ -72,6 +72,31 @@ Config: `/etc/zabbix/zabbix_agent2.d/gitea_backup.conf`
|
|||||||
|
|
||||||
> **Note:** Items and triggers are already configured via the Zabbix API.
|
> **Note:** Items and triggers are already configured via the Zabbix API.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### SSH push fails with `Permission denied (publickey)`
|
||||||
|
|
||||||
|
After a container rebuild/recreate, Gitea's `authorized_keys` can lose the user keys (only the internal `Gitea Host Key` remains in `/data/git/.ssh/authorized_keys`), even though the keys are still registered in the database. Symptom: `git push` over SSH is rejected although the key shows up under *Settings → SSH Keys*.
|
||||||
|
|
||||||
|
Rebuild `authorized_keys` from the database:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec -u git gitea gitea admin regenerate keys
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify the user key is back:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec gitea grep ssh-ed25519 /data/git/.ssh/authorized_keys
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Run this after any `gitea` container rebuild** if SSH access stops working.
|
||||||
|
|
||||||
|
### SSH port / remote URL
|
||||||
|
|
||||||
|
- Gitea SSH listens on host port **222** (mapped to container `22`).
|
||||||
|
- `git.alogins.net:222` is **not** reachable externally (not forwarded). Pushing from the Agap host itself must use `ssh://git@localhost:222/<user>/<repo>.git`.
|
||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|
||||||
- Gitea 1.25.3
|
- Gitea 1.25.3
|
||||||
|
|||||||
Reference in New Issue
Block a user