1.5 KiB
1.5 KiB
Client SSH Setup — Desktop / Laptop
Give this prompt to an AI on a desktop or laptop that needs SSH git access to this Gitea server.
Prompt
I need to set up SSH key authentication so I can push and pull git repos
from a self-hosted Gitea server.
SERVER DETAILS
--------------
Gitea URL: https://g.pozi.co.za
Admin user: gadmin
SSH (LAN): git@192.168.0.126 port 22
SSH (external): git@g.pozi.co.za port 2222
STEPS
-----
1. Generate SSH key (skip if ~/.ssh/id_gitea already exists):
ssh-keygen -t ed25519 -C "richard@teacup.co.za" -f ~/.ssh/id_gitea
2. Display the public key to add to Gitea:
cat ~/.ssh/id_gitea.pub
Add it at: https://g.pozi.co.za/user/settings/keys
Give it a descriptive name (e.g. "Desktop-hostname" or "Laptop-hostname")
3. Add to ~/.ssh/config:
# Gitea — LAN access (same network)
Host gitea-lan
HostName 192.168.0.126
User git
Port 22
IdentityFile ~/.ssh/id_gitea
# Gitea — external access (via port-forward)
Host g.pozi.co.za
HostName g.pozi.co.za
User git
Port 2222
IdentityFile ~/.ssh/id_gitea
4. Test connection:
ssh -T git@192.168.0.126 (LAN)
ssh -T git@g.pozi.co.za (external)
Expected: "Hi gadmin! You've successfully authenticated..."
5. Clone a repo:
git clone git@192.168.0.126:gadmin/REPONAME.git (LAN)
git clone git@g.pozi.co.za:gadmin/REPONAME.git (external)
NOTE: The public key must be added to Gitea before the SSH test will work.