Setting up SSH
Covered in this guide
- Generating a new ssh key
- Adding key to be used
- Uploading public key into Gitea
What you need to do everytime you boot
If you have never done this before, skip this section and go to Steps below, else:
- Start the agent:
eval $(ssh-agent -s)
- Add the key:
ssh-add C:\Users\%username%\.ssh\id_rsa
Steps
- Download and install Git for Windows
- NOTE: if you already have this installed, make sure you don't have ssh-keys already generated by navigating to:
C:\Users\%username%\.ssh
- Assuming this is your first time, generate a new key (please change %username% to your username! - you may also use your email address):
ssh-keygen -t rsa -b 4096 -C "%username%"
- When it asks you where to save, just press enter. It will default to
C:\Users\%username%\.ssh
- It will then ask for a passphrase. This isn't required, but you can add one if you so please; or, just press enter.
- Next, we need to add the new key to the Windows git agent, letting it know we can use this key.
- Start the agent:
eval $(ssh-agent -s)
- Then add the key:
ssh-add C:\Users\%username%\.ssh\id_rsa
- Now add your public key to Dou.Git
- Log in to Gitea and in upper right hand corner click on arrow and select "Settings" (Figure 1).
- Then click on SSH/GPG Keys.
- Then click on "Add Key" (Figure 2).
- Name the key something like your username and paste the contents of
C:\Users\%username%\.ssh\id_rsa_pub and then click "Add Key" (Figure 3).
- Congrats! You are now able to make changes, edits, and commits using SSH!
 |
| Figure 1 |
 |
| Figure 2 |
 |
| Figure 3 |