main
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Getting Started with Git
Step 1: Add Your Public SSH Key to Gitea
- Ensure your local machine's public SSH key is added to your Gitea account settings.
- Navigate to Gitea web interface.
- Go to
Settings>SSH/GPG Keysand clickAdd Key. - Paste the contents of your public key file (e.g.,
~/.ssh/id_rsa.pub) into the Content box and save.
Step 2: Configure Your Local SSH Client
- The critical step is configuring your local SSH client to use the cloudflared daemon as a proxy for the Gitea SSH hostname. This allows your SSH client to establish the connection through the Cloudflare tunnel instead of trying a direct connection.
- Edit your local SSH configuration file (
~/.ssh/config) and add the following entries:
Host git.rodneyosodo.com
HostName gitssh.rodneyosodo.com
Port 4021
User git
IdentityFile ~/.ssh/id_rsa # Path to your private SSH key
ProxyCommand /usr/bin/cloudflared access ssh --hostname %h
- Make sure to replace
/usr/bin/cloudflaredwith the actual path to the cloudflared executable on your local machine.
Step 3: Test the Connection
You should now be able to use standard Git SSH commands to interact with your Gitea repositories. Gitea will provide clone URLs like git@git.rodneyosodo.com:<username>/<repo>.git, which your local SSH config will intercept and route correctly through the tunnel.
Test the connection:
ssh -T git@git.rodneyosodo.com
You should see a message confirming you have successfully connected to Gitea via SSH.
Hi there, <username>! You've successfully authenticated with the key named <ssh-key-name>, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.
Clone a repository:
git clone git@git.rodneyosodo.com:rodneyosodo/getting-started-git-rodneyosodo.git
Description